OpenVZ Forum


Home » General » Support » can't allocate memory
Re: can't allocate memory [message #12284 is a reply to message #12265] Tue, 24 April 2007 08:51 Go to previous message
hvdkamer is currently offline  hvdkamer
Messages: 40
Registered: July 2006
Member
As said, the privvmpages is allaocated memory. Most of the times this isn't used at all. For example let's take one of my machines:

hoefnix2:~# ubc | grep -E 'priv' | sed -re 's/^(.{40}).*/\1/'
            privvmpages        6240
            privvmpages         913
            privvmpages         360
            privvmpages         378
            privvmpages       46847
            privvmpages       86436
            privvmpages       89116
            privvmpages       56970
            privvmpages       76104
            privvmpages       47447
            privvmpages       34170
            privvmpages       47919
            privvmpages       39446


It looks likes this machine is currently using 532.346 pages of 4 KiB is 2.079 MiB of memory. However:

hoefnix2:~# free
             total       used       free     shared    buffers     cached
Mem:       2053724    2020396      33328          0      51568    1475556
-/+ buffers/cache:     493272    1560452
Swap:      2104472     265072    1839400


excluding buffers, cache and shared it is only consuming 493.272 KiB of memory. You can roughly find this amount through physpages:

hoefnix2:~# ubc | grep -E 'phys' | sed -re 's/^(.{40}).*/\1/'
            physpages          1181
            physpages           202
            physpages           199
            physpages           232
            physpages          9384
            physpages          5168
            physpages         40408
            physpages         15069
            physpages          2171
            physpages          7003
            physpages          1595
            physpages           523
            physpages          3843


or 71.909 pages of 4 KiB is 287.636 KiB. The difference between this and 493.272 is allocated memory which is really in use. The difference between 2.129.384 and 493.272 is allocated memory which isn't used. Or at least not at this moment. That is why OpenVZ is so eeficient with hardware. You can use more memory than is strictly available Smile.

Memory usage in modern OSses is a very difficult thing. For example an image manipulation program could ask for say three times the memory needed for reading an image. The reserve is then used for undo buffers and things like that. For a programmer it is nice to ask for more than is needed. If given you can use it as you want and is in general more efficient. The drawback is that most times al lot of memory is alloacted but not used. When in need for more mmemory, it can be efficintly swapped.

Now for your problem:

            privvmpages       96595     105237      98304     131000       2672
            physpages         48643      54437          0 2147483647          0


As you can see your machine uses at this moment 48.643 pages of 4 KiB and in the past has used up to 54.437 pages. That is more than the most consuming VE on my machine. And that one can ask up till 131.072 as barrier and 147.456 as limit. So I think that the solution to your problem is lowering the physical amount used or raise the amount that can be allocated. In my experience the factor between these two parameters is between 3 and 5 with te lower in more consuming VE's. So with 54.437 I think you must raise the privvmpages to 163.840 (is 640 MiB). You could try 131.072 (512 MiB) and the optimizing the amount of started processes...


Henk van de Kamer
auteur Het Lab
http://www.hetlab.tk/
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: list of packages needed for compling
Next Topic: *SOLVED* control-C ignored in VE ??
Goto Forum:
  


Current Time: Sun Oct 13 17:19:03 GMT 2024

Total time taken to generate the page: 0.07920 seconds