ID: 40720 Updated by: [EMAIL PROTECTED] Reported By: soadlink at gmail dot com -Status: Open +Status: Feedback Bug Type: Performance problem Operating System: Ubuntu 6.10 PHP Version: 5.2.1 New Comment:
>However I only have to increase the memory limit on Ubuntu, but not Windows. Well, must likely on Windows you're using default php.ini with memory_limit = 128M >See the 'reproduce code' for the code. The code is quite useless, since we apparently cannot run it without the "c:\\list.txt". Previous Comments: ------------------------------------------------------------------------ [2007-03-05 01:40:29] soadlink at gmail dot com Description: ------------ I am working with a script that loads a list into an array and then echos each word in the array on a new line. See the 'reproduce code' for the code. I run my scripts with the CLI (not on a website), and it works great in Windows XP when loading lists as large as 375,000 words, and I can run plenty of instances of this script without lag issues (8+ command lines going at once!). But when I try to run the same script on Ubuntu 6.10 I get the following error: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 13491373 bytes). But that can easily be fixed by setting a larger memory limit such as: ini_set("memory_limit","75M"); However I only have to increase the memory limit on Ubuntu, but not Windows. And when I do up the memory limit on Ubuntu, only 1 or 2 instances can be run before the machine starts to bog down and get VERY slow. I'd assume this is because php is trying to load the entire list into memory in Ubuntu, but I am curious as to why Windows runs it fine. Is there something I can change on Ubuntu to make it run better? Or is this a bug with the Linux version oh PHP? The PCs are the same that I'm working with (I just removed the Windows install recently and put Ubuntu on there), and it has 1GB of ram, and an AMD64 3200+ processor. I'm just wondering if there is something I need to change to get the script to run like it did on Windows, ...without being a memory hog or having to increase the memory limit (since I didnt have to on Windows). Reproduce code: --------------- <?php $loadlist = array_map("rtrim", file("c:\\list.txt")); foreach ($loadlist as $word) { echo ($word . "\n"); } ?> Expected result: ---------------- I expect it to echo the words in the list (1 word per line). It works fine on Windows, but on Ubuntu 6.10 it is very very laggy with multiple instances, whereas with Windows it runs just fine. I can have dozens of instances of the script running on Windows, but not Ubuntu. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40720&edit=1