[wp-hackers] WP Memory usage

Francis Reyes Francis.Reyes at colorado.edu
Mon May 29 13:26:43 GMT 2006


http://ruckerz.oldbrownshoe.org/wp-admin/page-new.php and I got the  
error when the Page Templates in page-new.php were being loaded.

Interestingly, I did a memory_get_usage on the same page and got back  
3168424 bytes. Strange, something must have been going on when I got  
the error below that was pushing it above 8MB.  I recently lowered  
the memory limit to 8MB and everything seems to be working.  I think  
it was an aberrant plugin.

I wish there was a way to track memory leaks in php scripts :(

Thanks though,


On May 29, 2006, at 2:34 AM, Mark Jaquith wrote:

> On May 28, 2006, at 5:53 PM, Francis Reyes wrote:
>> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried  
>> to allocate 200 bytes) in /usr/share/wordpress/wp-admin/admin- 
>> functions.php on line 1166
>> Is it normal for people to exceed the 8MB allotment to PHP with WP  
>> 2.0.2? I've had to bump it up to 16MB. Maybe things  like  
>> $template_data in 1166 should be unset after each foreach loop?
> I've seen a few things knock WP over 8MB:
> - more than about 2000 users (on /wp-admin/users.php)
> 	- SOLUTION: make a paging/search systems for users... on the todo  
> list.
> - Textile2 on pages with 60+ posts
> 	- SOLUTION: show fewer pages, don't use Textile2, debug Textile2  
> to use less memory
> What page did you get that error on?
> It would be nice to stay under 8MB in more situations (especially  
> WP without any plugins!)  Many people are stuck at 8 and can't  
> change it... so that's a big problem.
> print_r($GLOBALS);  (please, please secure this...   <?php if  
> ( current_user_can('manage_options') && $_GET['dump_globals'] )  
> print_r($GLOBALS); ?> ) will show what is being left open in the  
> global space... in functions that use big arrays, we should unset  
> whenever we can, to save memory.
> --
> Mark Jaquith
> http://txfx.net/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

Francis Reyes M.Sc.
215 UCB
University of Colorado at Boulder

gpg --keyserver pgp.mit.edu --recv-keys 67BA8D5D

8AE2 F2F4 90F7 9640 28BC  686F 78FD 6669 67BA 8D5D

More information about the wp-hackers mailing list