Where is this array stored in memory?
From: Dimitri (antoniou_at_aecom.yu.edu)
Date: 08/20/04
- Previous message: TimC: "Re: GETARG in ifc"
- Next in thread: James Van Buskirk: "Re: Where is this array stored in memory?"
- Reply: James Van Buskirk: "Re: Where is this array stored in memory?"
- Reply: Richard Maine: "Re: Where is this array stored in memory?"
- Reply: M. Ranjit Mathews: "Re: Where is this array stored in memory?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 Aug 2004 21:24:24 -0700
Hi,
I saw some unexpected behavior of memory allocation in a program.
I am sure that the explanation is very simple,
I just don't know how memory allocation works.
I would be grateful if somebody could explain the following behavior.
In my program I have an array that is allocated dynamically
and has dimensions (1000,40000)
[ this array is continuously updated after every iteration of a do-loop ]
In two workstations, the program didn't compile at all,
because there was no space to store the huge array.
In another (Itanium) the program compiled and ran fine.
But when I increased the size of the array even more, eg (1000,50000)
it compiled but it ran extremely slowly.
Judging from the noise of the hard disk spinning, the program temporarily
wrote the array on disk after each iteration, or something like that.
If we store double precision numbers in the (1000,40000) array,
we occupy 32 Mb (is that right?)
and for the (1000,50000) array we need 40 Mb
I have 4 of the huge arrays, the other arrays in the program are small.
My question:
From the above behavior, it seems that the four 32 Mb arrays fit in some place
in memory that eventually can't accomodate 4*40 Mb
What is this place in memory?
Can I increase its storage capacity from the command line?
Also, when we dynamically allocate the four (1000,50000) arrays,
I assumed that we reserve 4*40 Mb somewhere.
But evidently the array somehow ends up being stored in the place
mentioned in the previous paragraph, that can hold only 4*32 Mb.
The processor was Itanium2 and the compiler was Intel 8.0 for Linux.
I didn't post the program because it's quite long
[a 40,000-timestep trajectory in a 1000-dimensional space is deformed
after each iteration of a do-loop, so the huge array is this trajectory]
Thanks,
Dimitri
- Previous message: TimC: "Re: GETARG in ifc"
- Next in thread: James Van Buskirk: "Re: Where is this array stored in memory?"
- Reply: James Van Buskirk: "Re: Where is this array stored in memory?"
- Reply: Richard Maine: "Re: Where is this array stored in memory?"
- Reply: M. Ranjit Mathews: "Re: Where is this array stored in memory?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|