On Fri, 22 Jul 2005, Silvio a Beccara wrote:
Thanks everybody for the advice,
I'd just like to point out the fact that I wasn't getting the error with GPC 2.1, but I must also say that the system I was running on was slightly different (I can talk to the administrator about this). I'll first see if I can reproduce the error on a different system, to see whether it depends on quota.
As for the number of arrays used, there are quite a few, about a hundred. As for possible bugs in my code, I can reproduce here the part where I declare and initialise the arrays: maybe something's wrong, or something I don't know changed from GPC 2.1.
GPC should not limit your memory use -- at the bottom layer it just uses `malloc'. Note that seemingly small change to the system can significantly change memory allocation. So first check that all other factors are equal.
If you are allocating _one_ array of 630Mb then the failure is very strange, even if something else has changed.
Box here is 2 cpu's with 2gb *shared* memory. I got exactly what I expected:
ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 16380 virtual memory (kbytes, -v) unlimited
free total used free shared buffers cached Mem: 2074748 228500 1846248 0 28988 170524 -/+ buffers/cache: 28988 2045760 Swap: 0 0 0
Next, ran this simple program:
program heaptest; var i: integer; buf: pointer; siz: cardinal;
begin for i := 1 to 255 do begin siz := i * 255 * 255 * 255; getmem( buf, siz); writeln("allocated ", siz," bytes"); freemem( buf ); end; end.
The output was: [..] allocated 1989765000 bytes allocated 2006346375 bytes allocated 2022927750 bytes heaptest: out of heap when allocating 2039509125 bytes (error #853 at 8049e61)
Hope this helps Russ