Hello all!
In the last months I had to "ALT-PRN-B"/reset many "almost dead" Linux
numbercrunchers (kernel 2.2.[0-10], glibc2 based, >=512MB mem, 1GB Swap,
2 PentiumII) here in our cluster, who seem to have died because of
memory mismanagement. If I start the following "wicked" ;) program twice
(in parallel) any of our "better" machine crashes silently once the mem
& swap are used up. If I start it on a 2.0.x machine, the job won't do
any harm.
Can anyone else reproduce my problem ... is it due to memory
overcommitment ? - if yes, how can I turn it off ;)
Regards
Oliver
#include <stdio.h>
#include <string.h>
#define MEM_MAX 1024 * 1024 * 10
main()
{
long mem_avail = MEM_MAX;
char *buf;
while(1)
{
printf("Trying to allocate %ld bytes: ", mem_avail);
if ((buf = (char *)malloc((size_t)mem_avail))){
printf(" success!\n");
memset(buf, 'X', mem_avail);
sleep(1);
} else {
printf(" failed :(\n");
mem_avail = mem_avail / 2;
sleep(1);
}
}
return 0;
}
--
/*
Oliver Stahlhut - Universitaet Hannover
Institut f�r Theoretische Nachrichtentechnik
und Informationsverarbeitung (TNT)
mailto:[EMAIL PROTECTED]
http://www.tnt.uni-hannover.de/~stahlhut/
*/
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]