0

I tried to use numa_alloc_onnode() to allocate 40GB of memory on a 32GB node by running the below code. However it does not report any errors.

a = (int *) numa_alloc_local (sizeof(int) * GB_8 * 5);
if (a == NULL)
    printf("a error\n");
for ( i = 0; i <GB_8*5; i++ )
    a[i] = (int)i;
printf("a done\n");

This is the specification of my machine. https://i.stack.imgur.com/bM2Gr.png

Can anyone please help explain?

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
user3743384
  • 91
  • 1
  • 11

1 Answers1

0

Until you actually try to STORE something in that memory, it's just vapor, imaginary... virtual even!

The system will say, SURE! you can have that much in your name... but it's all just 'on paper' until you use it.

If you were to try to store something in all that 40+GB of memory, then you'd most likely encounter errors... depends on the size of your swap space at that point.

The first three Google hits for overcommit:

https://www.kernel.org/doc/Documentation/vm/overcommit-accounting http://www.win.tue.nl/~aeb/linux/lk/lk-9.html http://searchservervirtualization.techtarget.com/definition/memory-overcommit

Just remember that until you store something there, it's all imaginary anyways.

lornix
  • 1,946
  • 17
  • 14