[RCD] Threads - first commit

A.L.E.C alec at alec.pl
Fri Nov 20 09:00:02 CET 2009

Chris January wrote:

> I tried both methods, but PHP runs out of memory in both cases.

I've made some tests and I think we can do nothing about this. The 
problem is not in preg_split, the problem is in PHP's arrays handling. 
Array with 150k items requires 20-30 MB of memory. Also at x86_64 the 
footprint is 25% bigger.

Simple test, an array with empty items:

$b = array_fill(0, 100000, NULL);

in-memory size for this array = 10MB!!!

So, if you're working with such big mailboxes, you'll need to increase 

Aleksander 'A.L.E.C' Machniak http://alec.pl gg:2275252
LAN Management System Developer http://lms.org.pl
Roundcube Webmail Project Developer http://roundcube.net
List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list