> > I have a script that allocates a lot of memory (huge associative arrays). > > The problem is that this scripts bails out with fatal error (emalloc > > unable to allocate 44 bytes) when I hit the limit of physical ram in the > > machine. Swap never gets used. The machine has 1 GB of ram and 2 GB of > > swap space. > > > > Has anyone seen something like this before? Are there any limitations in > > the PHP memory allocation code that would prevent it from being able to > > use more memory. > > Are you sure you are hitting the exact physical memory limit? What is > your "ulimit -d" (data segment size limit)?
I have checked all the limits and the problem wasn't there. It turns out that PHP + glibc-2.1.3 (RedHat 6.2 standard) + Kernel 2.2.22 is a bad combination when allocating large number of small memory chunks. Installing glibc-2.2.5 (scarry stuff to have to go through) solved the problem for me. Now building PHP with an alternative glibc on the system is not something I would recommend for light entertainment :) Anyway thanks to all who offered advice and have helped me track down and resolve this issue. Edin -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php