I'm trying to get to grips with memory limits reading the forums, OpenVZ and commercial VZ docs and getting slightly confused. In an earlier thread (on setting memory limits) a user on here was trying to set 128MB with the following command: vzctl set ID --vmguarpages=32768 --save (this example slightly wrong because there is a barrier and upper limit) but the logic being that each integer equals 4 KB so the value above should equal 128 MB However in hybodus config example (nicely commented btw) 128MB is represented by: #128 MB RAM VMGUARPAGES="6144:2147483647" LOCKEDPAGES="32:32" Also what is LOCKEDPAGES? Commercial VZ gives sample configs for 256, 512, 1024 and 2048MB VPS's as follows: #256MB VMGUARPAGES="33792:2147483647" LOCKEDPAGES="256:256" #512MB VMGUARPAGES="67584:2147483647" LOCKEDPAGES="512:512" #1024MB VMGUARPAGES="135168:2147483647" LOCKEDPAGES="1024:1024" #2048MB VMGUARPAGES="270336:2147483647" LOCKEDPAGES="2048:2048" Can someone explain the relationship between LOCKEDPAGES and setting memory limits. I'm probably being dim, but I'm trying to eatblish the logic between various configs given.
Locked pages are those, protected by mlock() or IPC_LOCK. These are rarely used, but if an application locks the page, it becomes unreclaimable and unswappable, so this resource should be controlled for sure. locked pages are usually used in security software to make sure that page won't be dropped from memory to swap etc. and password won't be foundable in swap file