Malloc problem Perl

From: Julianno Sambatti (jbsambatti_at_ucdavis.edu)
Date: 08/04/04


Date: Tue, 3 Aug 2004 17:34:36 -0700 (PDT)
To: beginners@perl.org


Hi all,

I have a perl code that reads a file into a list in an array of array. Then it rearranges each
nested array in another format - 4 columns instead of 2 - by randomly picking an element
of each array and reassembling another array. It's been working when the infile is small.
However, when it is large the program crashes and spits the following message:

*** malloc: vm_allocate(size=262144) failed with 3
*** malloc[591]: error: Can't allocate region
Out of memory!

which is obviously related to memory allocation.

Can someone help me fixing this problem?

Thanks

Julianno Sambatti



Relevant Pages

  • Re: Where is this array stored in memory?
    ... antoniou@aecom.yu.edu (Dimitri) wrote ... ... > I saw some unexpected behavior of memory allocation in a program. ... > because there was no space to store the huge array. ... > wrote the array on disk after each iteration, ...
    (comp.lang.fortran)
  • Re: Convert C-Builder program to Delphi?
    ... It's a simple memory allocation for an array of uint8s, ... The simplistic Delphi equivalent is GetMem, ... While UINT8 is not equal to uint8 in C++, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Convert C-Builder program to Delphi?
    ... It's a simple memory allocation for an array of uint8s, ... The simplistic Delphi equivalent is GetMem, ... While UINT8 is not equal to uint8 in C++, ...
    (comp.lang.cpp)
  • Re: Static allocation failure?
    ... Lets say I have an array that I declare statically in a function, ... but you are probably out of memory allocated to stack space! ... we tend to discourage users from declaring their arrays ... He apparently is unaware that there are basically three types of memory allocation in C - dynamic, static, and automatic. ...
    (comp.arch.embedded)
  • Where is this array stored in memory?
    ... I saw some unexpected behavior of memory allocation in a program. ... In my program I have an array that is allocated dynamically ... In two workstations, the program didn't compile at all, ... wrote the array on disk after each iteration, ...
    (comp.lang.fortran)