in reply to Unexpected 'Out of Memory'

It appears it is maybe a system limitation or error not a script error or a bug in Perl (Unless you use a different version other than 5.8).

I ran your original script on my RedHat Linux box and my Windows XP Laptop (running activeperl) and it ran fine on both.

[root@thegnuage perl-scripts]# perl -c abi abi syntax OK [root@thegnuage perl-scripts]# chmod a+x abi [root@thegnuage perl-scripts]# ./abi 1 is a square 4 is a square 9 is a square 16 is a square 25 is a square 36 is a square 49 is a square 64 is a square 81 is a square 100 is a square 1 is a square 4 is a square 9 is a square 16 is a square 25 is a square 36 is a square 49 is a square 64 is a square 81 is a square 100 is a square 1 is a square 4 is a square 9 is a square 16 is a square 25 is a square 36 is a square 49 is a square 64 is a square 81 is a square 100 is a square

The following is all I could capture from my Windows command prompt because XP's command.exe sux and I have not hacked the registry yet.

64 is a square 81 is a square 100 is a square 1 is a square 4 is a square 9 is a square 16 is a square 25 is a square 36 is a square 49 is a square 64 is a square 81 is a square 100 is a square 1 is a square 4 is a square 9 is a square 16 is a square 25 is a square 36 is a square 49 is a square 64 is a square 81 is a square 100 is a square

What amount of Ram have you got in your system? Are you running many resource intensive apps at the same time as the script (Like any java apps)?

You could have a program giving you a memory leak and be unaware of it therefore you really are out of memory. Try a reboot and run the script again with minimal system apps running.

If after all that if you still get the error I would try reinstalling your perl interpretor or just compiling the script with perl2exe and then run it. If you still have the error I would say your memory sticks are going bad or one or all your DIMM slots on your systemboard are going bad and therefore giving erroneous indications.

Replies are listed 'Best First'.
Re: Unexpected 'Out of Memory'
by Abigail-II (Bishop) on Jan 13, 2004 at 16:14 UTC
    What amount of Ram have you got in your system?
    Half a gig of RAM and a quarter of gig of swap space.
    Are you running many resource intensive apps at the same time as the script (Like any java apps)?
    No, the system is mostly idle. No java running. Just Netscape (approx 66 Mb) and X (about 100 Mb), and a few xterms running bash.

    I considered system resources, but it doesn't add up. Where the program runs out of memory is repeatable; it only does with 'map', and it doesn't run out of memory if you increase $MAX. That doesn't seem to be consistent with running out of system resources.

    The system is Redhat 7.3, running perl 5.8.2. Ah, I see I have 5.8.0 and 5.8.1 installed as well. It runs out of memory with 5.8.1 as well, but not with 5.8.0. Now, that's interesting.

    Abigail

      Ahh yes very interesting. It could be a specific version bug. Let us know what else you find.