lkml.org 
[lkml]   [2000]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectCan a process use up more than 910MB?

Hi all,

After reading/searching through this mailing list, I got the feeling a
process could use up to 3GB of virtual memory per default.

Since we really need this (We run commercial simulation tools like
ModelSim that uses up to 1.5GB today)

So, we write a small program (included below) to test this. The machine
had 1GB of physical memory and a a 2GB swap device. After each megabyte of
allocated memory the program prints the current allocated memory. Once no
more memory can be allocated, it sleeps for a while (long enough to check
the result with top) and then exits.
It turned out that a 2.1.12 kernel compiled for 1GB of physical memory
only allowed the process to allocate 910MB! Can anyone comment on this? I
believed it would be possible to use more... I also run two of these
processes in parallel, and then both got exactly the same amount, 910MB...

Thanks for everything.

/Peter


-----------------------------------
#include <string.h>
#include <stdlib.h>

main() {
int i;
void *x;
x = (void *)4;
for(i=0;x!=NULL;i++) {
x = malloc(1024);
if(x!=NULL) {
memset(x,1024,6);
if(i%1000)==0) {
printf("malloc %d\n",i/1000);
}
}
}
sleep(20);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [from the cache]
©2003-2011 Jasper Spaans