Can't start 5 processes each allocates 1G of VIRT memory, on OpenVZ with 2GB configured RAM. [message #38433] |
Sat, 19 December 2009 01:36 |
mriadus
Messages: 2 Registered: December 2009 Location: spb
|
Junior Member |
|
|
Hello.
My laptop: 2G, linux gentoo, no swap.
OpenVZ (on big 16-CPU xeon-server): 2G, linux gentoo, no swap.
A little program for my experiment:
...
char *p = new char [ 1024 * 1024 * 500 ];
...
Compiled to "/tmp/AAAA".
Starting 5 instances on laptop:
xx@master1 ~/forge/cpp $ ps aux | grep AAAA
xx 22257 0.0 0.0 514700 856 pts/29 T 05:06 0:00 /tmp/AAAA
xx 22894 0.0 0.0 514700 852 pts/21 S+ 05:06 0:00 /tmp/AAAA
xx 23200 0.0 0.0 514700 852 pts/44 S+ 05:06 0:00 /tmp/AAAA
xx 23443 0.0 0.0 514700 852 pts/45 S+ 05:06 0:00 /tmp/AAAA
xx 24023 0.0 0.0 514700 856 pts/56 S+ 05:07 0:00 /tmp/AAAA
xx 24224 0.0 0.0 514700 852 pts/59 S+ 05:07 0:00 /tmp/AAAA
(514700 = VIRT, 856 = RES)
As we can see, since am not using memory pages, it is available to allocate much more memory than we have physically.
The same experiment with OpenVZ has failed. I couldn't start more than ~2-3 instances of AAAA (limited by sum of their "VIRT"s). But ps's output for one instance of AAAA on OpenVZ is similar (in terms of VIRT and RES) to laptop's one:
xx 25554 0.0 0.0 523548 1024 pts/1 T 01:16 0:00 /tmp/AAAA
(VIRT=523548, RES=1024)
Interesting detail. Lets see to "htop" program. It has a general green "memory-meter" displaying amount of used memory, file cache etc... For laptop running one "AAAA" i can see that used memory increasing by AAAA's "RES" value (~1MB). But for OpenVZ i see increasing by ~500MB in this meter.
What parameters of OpenVZ resources limitation i should RTFM to allow processes have VIRTs like on real laptop? Need this very much. )
Thank you!
|
|
|