I was going through the Apache config turning off access.log on #32 when I noticed a considerable error.log file. It is entirely filled with PHP memory limit errors. I upped the memory_limit config in php.ini from 256M to 384M in response.

My question is, is that setting there because the tests *should* fail for exceeding 256, or was it just a convenient setting for allowing simpletest to do it's work so then 384 is ok as a new limit?

Sample errors:

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 24 bytes) in /home/davidn/web/public/sites/default/files/checkout/includes/registry.inc on line 170
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/davidn/web/public/sites/default/files/checkout/includes/registry.inc on line 170
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 24 bytes) in /home/davidn/web/public/sites/default/files/checkout/includes/registry.inc on line 170
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /home/davidn/web/public/sites/default/files/checkout/includes/registry.inc on line 170
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1 bytes) in /home/davidn/web/public/sites/default/files/checkout/includes/database/database.inc on line 1711

Comments

boombatower’s picture

The latter...so apparently we have a higher memory requirement. Possibly something that should be looked into...hmm.

deekayen’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Category: support » task

Just to update, before I deleted #34's VPS, I tried it for a while on 285M and that still wasn't enough. #32 seems to be happy with 384M.

Turning this into a task to increase the PIFR's self test recommended setting from 256M to 384M.

deekayen’s picture

Title: 256M memory_limit exceeded in testing » increase recommended php memory_limit to 384M
boombatower’s picture

Also need to up SimpleTests hook_requirements().

deekayen’s picture

Status: Active » Needs review
StatusFileSize
new1.17 KB
c960657’s picture

The patch in #550124: Remove prepared statement caching decreases the memory usage during test runs considerably. I doubt it will even get above 100 MB.

boombatower’s picture

Is there an easy way to measure that for sure?

deekayen’s picture

I'll see if I can setup xdebug to tell me somehow.

deekayen’s picture

xdebug makes a new xdebug_peak_memory_usage() function available at runtime, so there's a way.

Maybe I can just put that at the bottom of index.php, have it insert the value in a file or db table, and return with the results. Let's see what happens.

deekayen’s picture

I'm testing locally, not through PIFR. Here's how I'm testing:

pecl install xdebug

Create a table to store the memory numbers:

CREATE TABLE IF NOT EXISTS `xdebug` (
  `memory_usage` int(11) NOT NULL,
  `peak_memory_usage` int(11) NOT NULL,
  `time_index` double default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Insert this on the bottom of index.php:

db_query("INSERT INTO xdebug (memory_usage, peak_memory_usage, time_index) VALUES (%d, %d, %f)", xdebug_memory_usage(), xdebug_peak_memory_usage(), xdebug_time_index());

Activate simpletest and run them all. It gets to the openid tests locally, then I get

Fatal error: Call to undefined function bccomp() in /Users/davidnorman/Sites/drupalhead/modules/openid/openid.inc on line 313

Before then, the largest peak memory consumption value is 126.72238159 MB taking 95.77 seconds on my 2.4ghz Core duo, based on the result from:

SELECT memory_usage /1024 /1024, peak_memory_usage /1024 /1024, time_index
FROM xdebug
WHERE 1
ORDER BY peak_memory_usage DESC
LIMIT 1

Obviously, I'd have to try on a different, un-buggy computer to get the entire test, but that won't happen soon, which is why I put my methodology above. The above also doesn't tell which test is running to know which one is the biggest hog. Maybe there's something in the $GLOBAL environment that would help clue us in on that?

deekayen’s picture

Something is taking more memory. I used to be able to run concurrency 4 with 1GB ram... now it's swapping up to another 1GB to disk. Fields in core? That's the biggest recent thing...

moshe weitzman’s picture

the field and field ui tests are very ram hungry for some reason.

boombatower’s picture

Perhaps we can tweak them a bit.

c960657’s picture

It is my impression that the memory footprint during testing is now much smaller, possibly due to #496500: Remove global placeholder counter.

deekayen’s picture

Status: Needs review » Closed (fixed)

Nevermind. There seems to have been improvements since I filed this.