#40720 [NEW]: Huge arrays cause large memory usage in Ubuntu, but not Windows

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40720 [NEW]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    From: soadlink at gmail dot com
    Operating system: Ubuntu 6.10
    PHP version: 5.2.1
    PHP Bug Type: Performance problem
    Bug description: Huge arrays cause large memory usage in Ubuntu, but not Windows

    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 bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40720&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40720&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40720&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40720&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40720&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40720&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40720&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40720&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40720&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40720&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40720&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40720&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40720&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40720&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40720&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40720&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40720&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40720&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40720&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40720&r=mysqlcfg[/url]
    soadlink at gmail dot com Guest

  2. Similar Questions and Discussions

    1. #40363 [NEW]: Large Memory Usage and Slowness on strtotime()
      From: r dot craig at chester dot ac dot uk Operating system: Linux 2.6.5-7.282-bigsmp PHP version: 5.2.0 PHP Bug Type: ...
    2. #39584 [NEW]: Segmentation Fault with large memory usage
      From: rinse at solcon dot nl Operating system: Debian Linux 2.6.16.1 #1 SMP PHP version: 4.4.4 PHP Bug Type: Reproducible...
    3. #39584 [Opn->Fbk]: Segmentation Fault with large memory usage
      ID: 39584 Updated by: tony2001@php.net Reported By: rinse at solcon dot nl -Status: Open +Status: ...
    4. Flash Player 8 huge memory using during drag (all memory gone in few minutes) !!!
      Hi, my name is Ladislav Sopko and I am the project manager for our mapping solution MapWorld. MapWorld is a dynamic flash based cartographic...
    5. #25771 [NEW]: HUGE memory leak in ISAPI
      From: php at snazzyhost dot com Operating system: Windows XP SP1 PHP version: 4.3.3 PHP Bug Type: Performance problem Bug...
  3. #2

    Default #40720 [Opn->Fbk]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    Updated by: [email]tony2001@php.net[/email]
    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 [url]http://bugs.php.net/?id=40720&edit=1[/url]
    tony2001@php.net Guest

  4. #3

    Default #40720 [Fbk->Opn]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    User updated by: soadlink at gmail dot com
    Reported By: soadlink at gmail dot com
    -Status: Feedback
    +Status: Open
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:
    >Well, must likely on Windows you're using default php.ini with
    memory_limit = 128M

    Yes. And when I increase the memory limit on Ubuntu to match this the
    script runs, but more than 1-2 instances of it running causes the
    machines memory usage to go very high and slow the performance of
    everything (including the script). It doesn't do this in Windows XP Pro
    SP2 though. I can have plenty of instances running when that OS is
    installed with no problems.
    >The code is quite useless, since we apparently cannot run it without
    the "c:\\list.txt".

    395000 line test file took 20 seconds to make -
    [url]http://zero-labs.net/list.zip[/url]


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 10:08:57] [email]tony2001@php.net[/email]
    >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".

    ------------------------------------------------------------------------

    [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 [url]http://bugs.php.net/?id=40720&edit=1[/url]
    soadlink at gmail dot com Guest

  5. #4

    Default #40720 [Opn->Fbk]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    Updated by: [email]tony2001@php.net[/email]
    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:
    >Yes.
    Ok, so that's not a real problem then.
    >And when I increase the memory limit on Ubuntu to match this the
    >script runs, but more than 1-2 instances of it running causes the
    >machines memory usage to go very high and slow the performance of
    >everything (including the script).
    If each instance takes say 100Mb to run, then it's quite expected that
    10 instances running in the same time would take ~1Gb and make the
    machine to swap.



    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 10:38:38] soadlink at gmail dot com
    >Well, must likely on Windows you're using default php.ini with
    memory_limit = 128M

    Yes. And when I increase the memory limit on Ubuntu to match this the
    script runs, but more than 1-2 instances of it running causes the
    machines memory usage to go very high and slow the performance of
    everything (including the script). It doesn't do this in Windows XP Pro
    SP2 though. I can have plenty of instances running when that OS is
    installed with no problems.
    >The code is quite useless, since we apparently cannot run it without
    the "c:\\list.txt".

    395000 line test file took 20 seconds to make -
    [url]http://zero-labs.net/list.zip[/url]

    ------------------------------------------------------------------------

    [2007-03-05 10:08:57] [email]tony2001@php.net[/email]
    >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".

    ------------------------------------------------------------------------

    [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 [url]http://bugs.php.net/?id=40720&edit=1[/url]
    tony2001@php.net Guest

  6. #5

    Default #40720 [Fbk->Opn]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    User updated by: soadlink at gmail dot com
    Reported By: soadlink at gmail dot com
    -Status: Feedback
    +Status: Open
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:
    >If each instance takes say 100Mb to run, then it's quite expected
    that
    >10 instances running in the same time would take ~1Gb and make the
    >machine to swap.
    Then why does Windows handle plenty of instances just fine? I am trying
    to get the Linux machine to handle the script instances the same way
    Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
    8-12 running at once. Is there something inside Windows itself that is
    handling it better than in Linux, or something in PHP I can change?


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 10:46:20] [email]tony2001@php.net[/email]
    >Yes.
    Ok, so that's not a real problem then.
    >And when I increase the memory limit on Ubuntu to match this the
    >script runs, but more than 1-2 instances of it running causes the
    >machines memory usage to go very high and slow the performance of
    >everything (including the script).
    If each instance takes say 100Mb to run, then it's quite expected that
    10 instances running in the same time would take ~1Gb and make the
    machine to swap.


    ------------------------------------------------------------------------

    [2007-03-05 10:38:38] soadlink at gmail dot com
    >Well, must likely on Windows you're using default php.ini with
    memory_limit = 128M

    Yes. And when I increase the memory limit on Ubuntu to match this the
    script runs, but more than 1-2 instances of it running causes the
    machines memory usage to go very high and slow the performance of
    everything (including the script). It doesn't do this in Windows XP Pro
    SP2 though. I can have plenty of instances running when that OS is
    installed with no problems.
    >The code is quite useless, since we apparently cannot run it without
    the "c:\\list.txt".

    395000 line test file took 20 seconds to make -
    [url]http://zero-labs.net/list.zip[/url]

    ------------------------------------------------------------------------

    [2007-03-05 10:08:57] [email]tony2001@php.net[/email]
    >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".

    ------------------------------------------------------------------------

    [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 [url]http://bugs.php.net/?id=40720&edit=1[/url]
    soadlink at gmail dot com Guest

  7. #6

    Default #40720 [Opn->Fbk]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    Updated by: [email]tony2001@php.net[/email]
    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:
    >Then why does Windows handle plenty of instances just fine?
    Because your windows machine has more RAM?
    Because the script doesn't actually work?
    Because it works differently?
    I don't think I can tell you which of these is true.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 10:54:05] soadlink at gmail dot com
    >If each instance takes say 100Mb to run, then it's quite expected
    that
    >10 instances running in the same time would take ~1Gb and make the
    >machine to swap.
    Then why does Windows handle plenty of instances just fine? I am trying
    to get the Linux machine to handle the script instances the same way
    Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
    8-12 running at once. Is there something inside Windows itself that is
    handling it better than in Linux, or something in PHP I can change?

    ------------------------------------------------------------------------

    [2007-03-05 10:46:20] [email]tony2001@php.net[/email]
    >Yes.
    Ok, so that's not a real problem then.
    >And when I increase the memory limit on Ubuntu to match this the
    >script runs, but more than 1-2 instances of it running causes the
    >machines memory usage to go very high and slow the performance of
    >everything (including the script).
    If each instance takes say 100Mb to run, then it's quite expected that
    10 instances running in the same time would take ~1Gb and make the
    machine to swap.


    ------------------------------------------------------------------------

    [2007-03-05 10:38:38] soadlink at gmail dot com
    >Well, must likely on Windows you're using default php.ini with
    memory_limit = 128M

    Yes. And when I increase the memory limit on Ubuntu to match this the
    script runs, but more than 1-2 instances of it running causes the
    machines memory usage to go very high and slow the performance of
    everything (including the script). It doesn't do this in Windows XP Pro
    SP2 though. I can have plenty of instances running when that OS is
    installed with no problems.
    >The code is quite useless, since we apparently cannot run it without
    the "c:\\list.txt".

    395000 line test file took 20 seconds to make -
    [url]http://zero-labs.net/list.zip[/url]

    ------------------------------------------------------------------------

    [2007-03-05 10:08:57] [email]tony2001@php.net[/email]
    >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".

    ------------------------------------------------------------------------

    [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 [url]http://bugs.php.net/?id=40720&edit=1[/url]
    tony2001@php.net Guest

  8. #7

    Default #40720 [Fbk->Opn]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    User updated by: soadlink at gmail dot com
    Reported By: soadlink at gmail dot com
    -Status: Feedback
    +Status: Open
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:
    >Because your windows machine has more RAM?
    Just as I figured, you obviously didn't read my first post entirely,
    and have little clue what I was talking about... which is why I was
    repeating myself.
    >Because the script doesn't actually work?
    Actually it works just fine on Windows. Ubuntu is where I have the
    problems. What's that the 3rd time I've said that now?
    >Because it works differently?
    Really? Gee I didn't notice that. /sarcasm


    Anyways forget it. Don't even bother helping.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 11:02:17] [email]tony2001@php.net[/email]
    >Then why does Windows handle plenty of instances just fine?
    Because your windows machine has more RAM?
    Because the script doesn't actually work?
    Because it works differently?
    I don't think I can tell you which of these is true.

    ------------------------------------------------------------------------

    [2007-03-05 10:54:05] soadlink at gmail dot com
    >If each instance takes say 100Mb to run, then it's quite expected
    that
    >10 instances running in the same time would take ~1Gb and make the
    >machine to swap.
    Then why does Windows handle plenty of instances just fine? I am trying
    to get the Linux machine to handle the script instances the same way
    Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
    8-12 running at once. Is there something inside Windows itself that is
    handling it better than in Linux, or something in PHP I can change?

    ------------------------------------------------------------------------

    [2007-03-05 10:46:20] [email]tony2001@php.net[/email]
    >Yes.
    Ok, so that's not a real problem then.
    >And when I increase the memory limit on Ubuntu to match this the
    >script runs, but more than 1-2 instances of it running causes the
    >machines memory usage to go very high and slow the performance of
    >everything (including the script).
    If each instance takes say 100Mb to run, then it's quite expected that
    10 instances running in the same time would take ~1Gb and make the
    machine to swap.


    ------------------------------------------------------------------------

    [2007-03-05 10:38:38] soadlink at gmail dot com
    >Well, must likely on Windows you're using default php.ini with
    memory_limit = 128M

    Yes. And when I increase the memory limit on Ubuntu to match this the
    script runs, but more than 1-2 instances of it running causes the
    machines memory usage to go very high and slow the performance of
    everything (including the script). It doesn't do this in Windows XP Pro
    SP2 though. I can have plenty of instances running when that OS is
    installed with no problems.
    >The code is quite useless, since we apparently cannot run it without
    the "c:\\list.txt".

    395000 line test file took 20 seconds to make -
    [url]http://zero-labs.net/list.zip[/url]

    ------------------------------------------------------------------------

    [2007-03-05 10:08:57] [email]tony2001@php.net[/email]
    >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".

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    soadlink at gmail dot com Guest

  9. #8

    Default #40720 [Opn->Bgs]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    Updated by: [email]tony2001@php.net[/email]
    Reported By: soadlink at gmail dot com
    -Status: Open
    +Status: Bogus
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:

    ..


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 11:08:01] soadlink at gmail dot com
    >Because your windows machine has more RAM?
    Just as I figured, you obviously didn't read my first post entirely,
    and have little clue what I was talking about... which is why I was
    repeating myself.
    >Because the script doesn't actually work?
    Actually it works just fine on Windows. Ubuntu is where I have the
    problems. What's that the 3rd time I've said that now?
    >Because it works differently?
    Really? Gee I didn't notice that. /sarcasm


    Anyways forget it. Don't even bother helping.

    ------------------------------------------------------------------------

    [2007-03-05 11:02:17] [email]tony2001@php.net[/email]
    >Then why does Windows handle plenty of instances just fine?
    Because your windows machine has more RAM?
    Because the script doesn't actually work?
    Because it works differently?
    I don't think I can tell you which of these is true.

    ------------------------------------------------------------------------

    [2007-03-05 10:54:05] soadlink at gmail dot com
    >If each instance takes say 100Mb to run, then it's quite expected
    that
    >10 instances running in the same time would take ~1Gb and make the
    >machine to swap.
    Then why does Windows handle plenty of instances just fine? I am trying
    to get the Linux machine to handle the script instances the same way
    Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
    8-12 running at once. Is there something inside Windows itself that is
    handling it better than in Linux, or something in PHP I can change?

    ------------------------------------------------------------------------

    [2007-03-05 10:46:20] [email]tony2001@php.net[/email]
    >Yes.
    Ok, so that's not a real problem then.
    >And when I increase the memory limit on Ubuntu to match this the
    >script runs, but more than 1-2 instances of it running causes the
    >machines memory usage to go very high and slow the performance of
    >everything (including the script).
    If each instance takes say 100Mb to run, then it's quite expected that
    10 instances running in the same time would take ~1Gb and make the
    machine to swap.


    ------------------------------------------------------------------------

    [2007-03-05 10:38:38] soadlink at gmail dot com
    >Well, must likely on Windows you're using default php.ini with
    memory_limit = 128M

    Yes. And when I increase the memory limit on Ubuntu to match this the
    script runs, but more than 1-2 instances of it running causes the
    machines memory usage to go very high and slow the performance of
    everything (including the script). It doesn't do this in Windows XP Pro
    SP2 though. I can have plenty of instances running when that OS is
    installed with no problems.
    >The code is quite useless, since we apparently cannot run it without
    the "c:\\list.txt".

    395000 line test file took 20 seconds to make -
    [url]http://zero-labs.net/list.zip[/url]

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    tony2001@php.net Guest

  10. #9

    Default #40720 [Bgs->Csd]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    User updated by: soadlink at gmail dot com
    Reported By: soadlink at gmail dot com
    -Status: Bogus
    +Status: Closed
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:

    Closed, not bogus, as I voluntarily decided to end the problem.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 11:20:48] [email]tony2001@php.net[/email]

    ..

    ------------------------------------------------------------------------

    [2007-03-05 11:08:01] soadlink at gmail dot com
    >Because your windows machine has more RAM?
    Just as I figured, you obviously didn't read my first post entirely,
    and have little clue what I was talking about... which is why I was
    repeating myself.
    >Because the script doesn't actually work?
    Actually it works just fine on Windows. Ubuntu is where I have the
    problems. What's that the 3rd time I've said that now?
    >Because it works differently?
    Really? Gee I didn't notice that. /sarcasm


    Anyways forget it. Don't even bother helping.

    ------------------------------------------------------------------------

    [2007-03-05 11:02:17] [email]tony2001@php.net[/email]
    >Then why does Windows handle plenty of instances just fine?
    Because your windows machine has more RAM?
    Because the script doesn't actually work?
    Because it works differently?
    I don't think I can tell you which of these is true.

    ------------------------------------------------------------------------

    [2007-03-05 10:54:05] soadlink at gmail dot com
    >If each instance takes say 100Mb to run, then it's quite expected
    that
    >10 instances running in the same time would take ~1Gb and make the
    >machine to swap.
    Then why does Windows handle plenty of instances just fine? I am trying
    to get the Linux machine to handle the script instances the same way
    Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
    8-12 running at once. Is there something inside Windows itself that is
    handling it better than in Linux, or something in PHP I can change?

    ------------------------------------------------------------------------

    [2007-03-05 10:46:20] [email]tony2001@php.net[/email]
    >Yes.
    Ok, so that's not a real problem then.
    >And when I increase the memory limit on Ubuntu to match this the
    >script runs, but more than 1-2 instances of it running causes the
    >machines memory usage to go very high and slow the performance of
    >everything (including the script).
    If each instance takes say 100Mb to run, then it's quite expected that
    10 instances running in the same time would take ~1Gb and make the
    machine to swap.


    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    soadlink at gmail dot com Guest

  11. #10

    Default #40720 [Csd->Bgs]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    Updated by: [email]tony2001@php.net[/email]
    Reported By: soadlink at gmail dot com
    -Status: Closed
    +Status: Bogus
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:

    "Closed" means there was a problem and it has been fixed.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 11:25:45] soadlink at gmail dot com

    Closed, not bogus, as I voluntarily decided to end the problem.

    ------------------------------------------------------------------------

    [2007-03-05 11:20:48] [email]tony2001@php.net[/email]

    ..

    ------------------------------------------------------------------------

    [2007-03-05 11:08:01] soadlink at gmail dot com
    >Because your windows machine has more RAM?
    Just as I figured, you obviously didn't read my first post entirely,
    and have little clue what I was talking about... which is why I was
    repeating myself.
    >Because the script doesn't actually work?
    Actually it works just fine on Windows. Ubuntu is where I have the
    problems. What's that the 3rd time I've said that now?
    >Because it works differently?
    Really? Gee I didn't notice that. /sarcasm


    Anyways forget it. Don't even bother helping.

    ------------------------------------------------------------------------

    [2007-03-05 11:02:17] [email]tony2001@php.net[/email]
    >Then why does Windows handle plenty of instances just fine?
    Because your windows machine has more RAM?
    Because the script doesn't actually work?
    Because it works differently?
    I don't think I can tell you which of these is true.

    ------------------------------------------------------------------------

    [2007-03-05 10:54:05] soadlink at gmail dot com
    >If each instance takes say 100Mb to run, then it's quite expected
    that
    >10 instances running in the same time would take ~1Gb and make the
    >machine to swap.
    Then why does Windows handle plenty of instances just fine? I am trying
    to get the Linux machine to handle the script instances the same way
    Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
    8-12 running at once. Is there something inside Windows itself that is
    handling it better than in Linux, or something in PHP I can change?

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    tony2001@php.net Guest

  12. #11

    Default #40720 [Bgs]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    User updated by: soadlink at gmail dot com
    Reported By: soadlink at gmail dot com
    Status: Bogus
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:

    Then it is neither bogus or closed, because a problem does exist, so it
    is definitely not bogus.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 11:30:59] [email]tony2001@php.net[/email]

    "Closed" means there was a problem and it has been fixed.

    ------------------------------------------------------------------------

    [2007-03-05 11:25:45] soadlink at gmail dot com

    Closed, not bogus, as I voluntarily decided to end the problem.

    ------------------------------------------------------------------------

    [2007-03-05 11:20:48] [email]tony2001@php.net[/email]

    ..

    ------------------------------------------------------------------------

    [2007-03-05 11:08:01] soadlink at gmail dot com
    >Because your windows machine has more RAM?
    Just as I figured, you obviously didn't read my first post entirely,
    and have little clue what I was talking about... which is why I was
    repeating myself.
    >Because the script doesn't actually work?
    Actually it works just fine on Windows. Ubuntu is where I have the
    problems. What's that the 3rd time I've said that now?
    >Because it works differently?
    Really? Gee I didn't notice that. /sarcasm


    Anyways forget it. Don't even bother helping.

    ------------------------------------------------------------------------

    [2007-03-05 11:02:17] [email]tony2001@php.net[/email]
    >Then why does Windows handle plenty of instances just fine?
    Because your windows machine has more RAM?
    Because the script doesn't actually work?
    Because it works differently?
    I don't think I can tell you which of these is true.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    soadlink at gmail dot com Guest

  13. #12

    Default #40720 [Bgs]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    Updated by: [email]stas@php.net[/email]
    Reported By: soadlink at gmail dot com
    Status: Bogus
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:

    I the Linux OS 64-bit? Then difference in memory requirements are
    easily explained - on 64-bit pointers and longs are twice as long as on
    32-bit, and PHP uses both a lot in variables, so memory requirement for
    huge array can be significantly bigger on 64-bit OS.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 11:37:51] soadlink at gmail dot com

    Then it is neither bogus or closed, because a problem does exist, so it
    is definitely not bogus.

    ------------------------------------------------------------------------

    [2007-03-05 11:30:59] [email]tony2001@php.net[/email]

    "Closed" means there was a problem and it has been fixed.

    ------------------------------------------------------------------------

    [2007-03-05 11:25:45] soadlink at gmail dot com

    Closed, not bogus, as I voluntarily decided to end the problem.

    ------------------------------------------------------------------------

    [2007-03-05 11:20:48] [email]tony2001@php.net[/email]

    ..

    ------------------------------------------------------------------------

    [2007-03-05 11:08:01] soadlink at gmail dot com
    >Because your windows machine has more RAM?
    Just as I figured, you obviously didn't read my first post entirely,
    and have little clue what I was talking about... which is why I was
    repeating myself.
    >Because the script doesn't actually work?
    Actually it works just fine on Windows. Ubuntu is where I have the
    problems. What's that the 3rd time I've said that now?
    >Because it works differently?
    Really? Gee I didn't notice that. /sarcasm


    Anyways forget it. Don't even bother helping.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    stas@php.net Guest

  14. #13

    Default #40720 [Bgs]: Huge arrays cause large memory usage in Ubuntu, but not Windows

    ID: 40720
    User updated by: soadlink at gmail dot com
    Reported By: soadlink at gmail dot com
    Status: Bogus
    Bug Type: Performance problem
    Operating System: Ubuntu 6.10
    PHP Version: 5.2.1
    New Comment:

    Yea it's a 64 bit OS. Thanks for the explanation on the differences, I
    didn't know that.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-05 19:15:12] [email]stas@php.net[/email]

    I the Linux OS 64-bit? Then difference in memory requirements are
    easily explained - on 64-bit pointers and longs are twice as long as on
    32-bit, and PHP uses both a lot in variables, so memory requirement for
    huge array can be significantly bigger on 64-bit OS.

    ------------------------------------------------------------------------

    [2007-03-05 11:37:51] soadlink at gmail dot com

    Then it is neither bogus or closed, because a problem does exist, so it
    is definitely not bogus.

    ------------------------------------------------------------------------

    [2007-03-05 11:30:59] [email]tony2001@php.net[/email]

    "Closed" means there was a problem and it has been fixed.

    ------------------------------------------------------------------------

    [2007-03-05 11:25:45] soadlink at gmail dot com

    Closed, not bogus, as I voluntarily decided to end the problem.

    ------------------------------------------------------------------------

    [2007-03-05 11:20:48] [email]tony2001@php.net[/email]

    ..

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/40720[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=40720&edit=1[/url]
    soadlink at gmail dot com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139