OpenVZ Forum


Home » General » Support » Is privvmpages's MAX limited to the amount of RAM on a computer
Re: Is privvmpages's MAX limited to the amount of RAM on a computer [message #35022 is a reply to message #35015] Fri, 20 February 2009 19:04 Go to previous messageGo to previous message
CatDaaaady is currently offline  CatDaaaady
Messages: 7
Registered: September 2008
Location: 94555
Junior Member
Another interesting note.
I created some code to malloc and take up about 2G worth of memory.
I set the VE to 4G of memory to match the RAM on the hardware node.
Then I run the program. As you can see below I can only run the program 2 times before I get a malloc error.
vzctl set 33503 --privvmpages 4G

*Inside the VE*
$  free -m
             total       used       free     shared    buffers     cached
Mem:          3926         73       3853          0          0          0
-/+ buffers/cache:         73       3853
Swap:            0          0          0
$


$ ./allocateandfill &
[1] 32375
$ ./allocateandfill &
[2] 32376
$ Success
./allocateandfill &
[3] 32377
$ malloc: Cannot allocate memory

$  free -m
             total       used       free     shared    buffers     cached
Mem:          3926       3926          0          0          0          0
-/+ buffers/cache:       3926          0
Swap:            0          0          0
$


So the above error is expected.

Then I set the VE to something over the amount of physical ram on the hardware node...
vzctl set 33503 --privvmpages 6G

*Inside the VE*
$ free -m
             total       used       free     shared    buffers     cached
Mem:          3926         73       3853          0          0          0
-/+ buffers/cache:         73       3853
Swap:            0          0          0
$

NOTICE no change in the total memory!!?!!

$  ./allocateandfill &
[1] 32483
$  ./allocateandfill &
[2] 32484
$  ./allocateandfill &
[3] 32485
$

NOTICE no errors!

$ free -m
             total       used       free     shared    buffers     cached
Mem:          3926       3926          0          0          0          0
-/+ buffers/cache:       3926          0
Swap:            0          0          0
$


Memory is totally used up. And it shows just 4Gs. "top" shows the same.

*On the Hardware node*
free -m
             total       used       free     shared    buffers     cached
Mem:          3926       3810        116          0          0          8
-/+ buffers/cache:       3800        125
Swap:         4094       1678       2415


Notice the hardware node is using all its ram and half the swap. As expected. It needs to grab 6G from somewhere.

So my question: What's up? Why does the VE not show all the memory it has available to it???
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Accessing host directory/parition from VPS
Next Topic: two NICs in openvz
Goto Forum:
  


Current Time: Thu Sep 18 05:39:42 GMT 2025

Total time taken to generate the page: 0.06089 seconds