Title: theme memory leak?
Last modified: August 20, 2016

---

# theme memory leak?

 *  [s0206](https://wordpress.org/support/users/s0206/)
 * (@s0206)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/)
 * I purchased a theme vis theme forest and ever since I installed it I have had
   my site go down too many times.
 * After spending a lot of time investigating this I am certain that the theme is
   the problem. When I switch to a default wp theme, everything is fine. I used 
   a web stress tool to hit the site a few hundred times but it crashed, I performed
   the same test after activating the default theme and no prblems whatsoever.
 * I contacted the theme developer who is insisting it must be a plugin and not 
   his theme.
 * My question is, how does one go about trying to find a memory leak in a theme?
   What should I be looking for? Would it be an open database connection that hasn’t
   been closed?
 * Any tips would be greatly appreciated.
 * Thanks in advance

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3043994)
 * That’s a little like asking how long is a piece of string. A rogue script may
   not even connect to the database but simply drop into an infinite loop – consuming
   CPU cycles as it does. Have you tried:
 * – deactivating **all** plugins to see if this resolves the problem. If this works,
   re-activate the plugins one by one until you find the problematic plugin(s).
 * – [resetting the plugins folder](http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F)
   by PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.
 * If you run all of those tests and prove that the theme crashes the site when 
   there are absolutely no plugins running, then I don’t see how the theme dev can
   deny that it’s his theme at fault.
 *  Thread Starter [s0206](https://wordpress.org/support/users/s0206/)
 * (@s0206)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3043999)
 * Thanks you Esmi!
 * I will follow your tips and see how it goes.
 * I did deactivate all the plugins and the theme, there was no problems.
    I then
   activated the plugins one by one whilst using the default wp theme again no problems.
 * I then deactivated all the plugins but activated the theme I purchased and the
   problems came back.
 * I will try resetting the plugins folder and investigate further.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044000)
 * It might also be worth checking your site’s error logs to see if it offers any
   concrete clues as where the problem is.
 *  Thread Starter [s0206](https://wordpress.org/support/users/s0206/)
 * (@s0206)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044004)
 * Ok, I will do that too.
 * Thanks again Esmi.
 *  Thread Starter [s0206](https://wordpress.org/support/users/s0206/)
 * (@s0206)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044039)
 * On the last day the site went down, the error log shows out of memory messages.
   Most of them are specific to W3 Total Cache Plugin and one is specific to the
   theme’s function file:
 * Here is a snippet of the error log:-
 * [12-Sep-2012 15:43:59] PHP Fatal error: Out of memory (allocated 2621440) (tried
   to allocate 142048 bytes) in /home/site-a/public_html/wp-content/themes/child-
   theme/functions.php on line 24
 * [12-Sep-2012 15:49:59] PHP Fatal error: Out of memory (allocated 5505024) (tried
   to allocate 73729 bytes) in /home/site-a/public_html/wp-content/plugins/w3-total-
   cache/lib/W3/Cache/File.php on line 153
 * Could it be that Total Cache is causing some problems?
 * I’m still trying to pinpoint the problem 🙂
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044040)
 * I think you need to check how much PHP memory you have available. You need at
   least 32M to run WordPress but, if you want to install plugins or flashy themes,
   you should have 64M OR 128M.
 *  Thread Starter [s0206](https://wordpress.org/support/users/s0206/)
 * (@s0206)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044058)
 * I’ve just checked and it was 32M but I have increased it to 128M.
 * Esmi, thank you for your help here today, it’s very much appreciated. I will 
   continue to investigate and hopefully have this problem resolved quickly.
 * Is it ok to pop back if I have a few more questions?
 * 🙂
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044059)
 * By all means but I’d suggest posting a new topic is there’s a gap of more than
   about 24 hours.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘theme memory leak?’ is closed to new replies.

 * 8 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/theme-memory-leak/#post-3044059)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
