memory allocation fails at different points for different programs

yuri_at_tsoft.com
Date: 05/28/05


Date: 28 May 2005 07:49:40 -0700

I have Linux sustem:
l-sim-25-124 2.4.21-15.ELsmp ran on Intel Xeon with 2 GB memory (not
sure about memory).

When I run my simple test program that allocates memory in 100MB chunks
it fails only when it tries to allocate 3 GB.

But when I run real large program memory allocation fails at ~1.6 GB.
Difference is that real program also did a lot of CPU/disk activity
during the run
and was allocating in less regular chunks as was needed.

Failure occures @ allocating with malloc of some small block ~20KB so
fragmentation shouldn't be an issue.

Why in exactly the same environment two programs consistently fail at
different memory points ?

My suspicion is that kernel has some policy when to fail process
depending on it's profile.
Is this the case or what might be the reason ?

Thanx,
Yuri


Quantcast