Allocate lots of memory => core dump

Marc Schmitt schmitt at inf.ethz.ch
Mon Jan 20 13:24:01 CST 2003


Hi all,

This is not very Dell specific, but I hope someone of you has 
encountered this problem and knows what to do about it.

I'm running a small C++ program (attached) that does nothing else than 
endlessly allocate chunks of 1MB of memory on various RedHat 7.3 
installations (kernel 2.4.18-19.7.xsmp) on different Dell PowerEdge 
servers. Those servers have between 2 and 4 GB RAM and at least 2GB of 
SWAP. Having said that, I expect the program to be able to allocate 
around 3.5GB of RAM (or whatever the per process maximum is on an IA32 
machine).

But:
< --- zip --- >
Total allocated:2930 Mbytes
Allocation of 1 Mbytes
Total allocated:2931 Mbytes
Allocation of 1 Mbytes
Abort (core dumped)

running with strace:

mmap2(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0xbfdf2000
write(1, "Total allocated:2930 Mbytes\n", 28Total allocated:2930 Mbytes) 
= 28
write(1, "Allocation of 1 Mbytes\n", 23Allocation of 1 Mbytes) = 23
mmap2(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = 0xbfef3000
write(1, "Total allocated:2931 Mbytes\n", 28Total allocated:2931 Mbytes) 
= 28
write(1, "Allocation of 1 Mbytes\n", 23Allocation of 1 Mbytes) = 23
mmap2(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x400c7000)                         = 0x3ffc6000
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
getpid()                                = 11915
kill(11915, SIGABRT)                    = 0
--- SIGABRT (Aborted) ---
+++ killed by SIGABRT +++

Obviously, the program can not allocate more than 2931MB (ENOMEM). Can 
someone explain this to me? Is this correct or is there a parameter in 
/proc/sys I have to change to be able to allocate more memory for a 
process? Thanks for any help.

Regards,
    Marc

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testmem.cc
Url: http://lists.us.dell.com/pipermail/linux-poweredge/attachments/20030120/17d09b2d/testmem.bat


More information about the Linux-PowerEdge mailing list