Infrequently as I'm working with the backend of my Drupal site I get an error notice like this:

Fatal error: Out of memory (allocated 46137344) (tried to allocate 72 bytes) in /home/testsite/public_html/includes/cache.inc on line 439

I'm under the impression that I only notice this problem during high traffic periods for the website.
I'm assuming Drupal's page serving activity and my backend work are competing for the same memory resources and hence I get the error above. - Is that right?

I'm using shared hosting for this site. cPanel seems to suggest that I have 1GB of "Virtual Memory" available. Does that number seem in line or typical or is there a different type of memory my server allows me that I need to investigate?

---
I think in the past when I had this type of problem my host boosted up my PHP memory limit.
I see that it's set at 512M.
I've Googled around and really don't seem to find mention of anyone really using more than 512M to run Drupal. Is 512M usually the upper limit a person would typically choose to use?

I'm assuming all of this problem stems from the fact that I'm probably employing too many modules. And considering my total memory limit and current PHP memory settings that I should investigate culling back on the number of modules as a solution?

Thanks.

Comments

pixelsweatshop’s picture

I'm assuming Drupal's page serving activity and my backend work are competing for the same memory resources and hence I get the error above. - Is that right?

Have a look at https://www.drupal.org/node/76156 as it explains what is going on.

Shared hosting means exactly that. You are sharing all the server resources. You may not have 1GB of dedicated RAM.

There is no "typical" amount, only a minimum required for Drupal. It will depend on many factors (number of modules installed, authenticated traffic, caching strategies). Heck one poorly coded module can eat up your system resources.

Try uninstalling unnecessary modules, disabling unused UI modules, debugging the pages the issue happens on. There are so many reasons that this can happen.

There are a few performance debugging blogs posts out there. Since each site is different, each solution will be different.

As a someone who struggled in the early years with Drupal, shared hosting just plainly sucks for it. Get yourself a VPS or use something like pantheon or acquia.

sprite’s picture

Yes, beyond a certain resource load, whether page serving scale, or other resource load, a VPS or dedicated server becomes a necessity for efficiently operating a Drupal website.

With a VPS, the VPS can be configured with adequate virtual memory and adequate numbers of virtual cpus/threads to handle all the current tasks that may need to operate on a resource intensive Drupal website.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

onejam’s picture

Not sure about your hosting provider but some do allow you to override the PHP memory limit and set your own value. Create a php.ini file and drop this into the root directory of your site. Inside the file add:

memory_limit = 512M

Like i said, this might not work on your host since their server might be configure to look in the .htaccess file for any PHP override? so consult with your host to find out if it is possible.

-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien