Editing
Memory Management
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span id="Applying_this_to_vservers" class="mw-headline">Applying this to vservers</span> == '''Q.''' So how does this all map onto VSZ and RSS (in vserver-stat) or VIRT/RES/SHR in top/vtop stats? Good questions, and well, they are simply answered for a task: * the VSZ for a task is the amount of pages which have a mapping * the RSS (resident set size) is the amount of pages which are currently in RAM (physical memory) * shared is memory that is mapped between two applications <pre>VSZ=VIRT = number of pages currently mapped RSS=RES = number of pages currently in RAM</pre> This accounting is a little more problematic if you want to do it for, let's say two processes. First, what do you do about the address space? look for identical mappings and count them only once, or take the maximum of both? or just add them up? And it's even more complicated for the RSS because we can have shared RAM (e.g. inode caches, executables and we can have shared but copy on write pages and we can also have purely anonymous pages, that only belong to a single task. well, actually shared memory can belong to no task, but that probably complicates things for now, so let's say a single task. Linux-Vserver tries to be as unintrusive as possible here and, of course, we try to keep it simple and efficient too. So what we do is mainly accounting the allocations and deallocations of those pages per context, which gives values (and if limited limits) which might not be directly mappable to physical RAM (or swap space, which we didn't even mention yet). We decided to 'simply add up' the address space of all tasks and call that VM/AS. <pre>VM/AS = virtual memory pages (total) in a context</pre> <span id="swap"></span> === <span id="swap" class="mw-headline"> swap </span> === We also decided not to account the shared pages special as [OVZ] does, instead we simply add them up in separate counters. A currently missing accounting/limit is the swap space because accounting the swap space properly would require a 'tag' on each memory page to know which context it belongs to, which is something I don't want to do without good reason, as there are * many pages, and * this stuff is really performance critical! </div> <div class="printfooter"> Retrieved from "http://wiki.linux-vserver.org/index.php?title=Memory_Management&oldid=4923" </div> <div id="catlinks" class="catlinks"> <div id="mw-normal-catlinks" class="mw-normal-catlinks"> [[Special:Categories|Category]]: * [[Category:Theory|Theory]] </div> </div> <div class="visualClear"> </div> </div> </div>
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information