Hi -

I'm trying to migrate a locally-developed site to a staging server on a shared hosting. I copied over the files and the database and updated local paths and DB connection strings. However, I'm running into memory errors such as the following:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in [DOCROOT]/sites/all/modules/views/handlers/views_handler_filter.inc on line 596

Is 32MB simply not enough to run Drupal with a few bells and whistles? Any suggestions?

Thanks!

Comments

vm’s picture

The more modules you add the more memory that needs to be allocated. Larger modules need larger amounts of memory.

I'm set at 128M in most cases to run Drupal and a handful of modules, that include CCK Views and modules that handle my images.

Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)...

you will find that if your site gets popular you will need to get on a VPS or a Dedicated box. Welcome to dynamic website development and Web 2.0

System Requirements = http://drupal.org/requirements
however that is just to run core. note: Drupal 6 requires 16M all by itself.

greenbeans’s picture

OK, I figured out how to up my memory limit to 64MB (somewhat surprised my host allows it). I've got a bunch of necessary modules, plus am running CiviCRM. I've only run into one memory limit error since (when clearing the cache from the Devel module variable list page).

I'm still in development mode. Does enabling caching generally decrease memory usage, or will I need to go up to 128M to ensure my viewers don't get memory errors? Traffic should be low, but I'm a little concerned about the host shutting us down if we hog too much memory.

vm’s picture

I'd assume once you are in production state you will be removing devel.module and other modules that aid in development. I tend not to deploy those on my production sites and when they are needed I use them on my local machine which is where I do the bulk of my development. Especially on Databases with content already involved.

caching does help some. 3rd party caching helps more.

Setting your memory limit too high can have adverse effects as well from what I understand. beyond that you are in competition for memory with every other site on that server.

greenbeans’s picture

Yup, I'll be disabling Devel. I'm not sure anything else development-specific is installed at the moment. Unfortunately, I have to do a bit of development on the shared host instead of locally because I'm working on integration with a third-party payment processor that relies on cURL requests back to my site (don't get me started...).

I'm fairly certain the client can't afford a VPS, so we're stuck with shared for the time being. What sorts of adverse effects can a too-high memory limit have?

Also, do you have any recommendations WRT third-party caching options?

Thanks!

vm’s picture

read 2bits.com articles with regards to 3rd party caching. I don't believe many shared hosts allow you to install 3rd party caching mechanisms. If the shared host doesn't allow shell access I can almost guarantee they don't.

too high a memory limit have = your host can get aggragvated because you may be making other customers suffer as you are hogging resources. Beyond that I don't know as I've never experienced it 1st hand. Only picked up information here on the forums.

greenbeans’s picture

We do have shell access but obviously not root access. I'll take a look at that site - thank you.

greenbeans’s picture

Just a note that those articles were useful. The Boost module looks like just what we need, since the site is 90% static and will be changing infrequently. My only concern is that the plugin is in a questionably stable alpha state, which makes me nervous for a production site -- and there's no evidence of development activity for 3 months.

Thanks again for your help!