Jason Bradfield wrote:
Actually put simply how can both of these be true...

 From Bob
* swap: the amount of disk space set aside to copy physical memory to when copying it out of RAM

 From Jeff
set swap=      this is VM - the total address space available to the zone


Bob and I used different definitions of the word 'swap.' Because there are different definitions out there, I provided mine solely for use in my description.

While we're here, I'll further clarify my earlier response. For the purposes of the swap cap, when Solaris is counting up the memory pages used by the processes in a zone, it does not count shared program pages (called 'text pages' in Unix lingo).

In Solaris, these non-writable pages are shared by all users running the same program. This reduces physical memory usage and I/O traffic. There is no need to ever page them out because they already have a copy on disk - the file system.

The same is true for users in the global zone and sparse-root zones - all users in those environments use the same /usr/bin/ls, and share the same text pages for that program. When a swap cap has been applied to a zone, those text pages are not counted, because there is no swap reservation for them.

Therefore: a slightly more accurate way of answering "what is a swap cap" is: the maximum amount of space used by physical memory and disk-based swap in use by a zone, *minus* the size of the text pages in use by that zone.





Jason Bradfield wrote:
Thanks Bob and Jeff...

Therefore here is my confusion..

I have 16GB physical and 16GB disk as swap giving me a total of 32G of virtual memory.. For simplicity I then create 4 zones each with 4G physical and 8G swap (VM in zone) From what Jeff confirmed is this will give me 4G physical and 4G disk as swap. From Bob I'll have 8G per zone "amount of disk space set aside to copy physical memory to when copying it out of RAM" but the system only has 16GB total..


Also if swap is the amount of disk able to be swaped to then why does swap -s give me 32G when really it should be 16G.


Bob Bownes wrote:

>> Can anyone, in lamens (ex linux) terms explain the differences between
>> virtual/swap/rss/size/physical etc or recomend a good
>> blog/article/document.
>
>I don't know Linux terms, so I'll define terms for this conversation:
>* physical memory: RAM, memory chips
>* VM (virtual memory): the total memory space available, both in RAM and
>   on disk
>


I'll add:

* swap: the amount of disk space set aside to copy physical memory to when copying it out of RAM * rss: Resident Set Size - the part of a process address space which is currently resident in RAM
* size: The total address space used by a process
* physical - various definitions, most common one i've seen is the total amount of RAM in the system. Also refered to as 'real' in some places

And a link I found that might be of some use:

http://www.memorymanagement.org/


>The terms in zonecfg are:
>* set physical=  this is what I am calling "physical memory"
>* set swap= this is VM - the total address space available to the zone
>
>So if you want to limit the zone's processes to 384MB of VM and 128MB of RAM, use:
>
>add capped-memory
>set physical=128m
>set swap=384m
>end

>If you already have added these, you must use "select capped-memory" instead
>of "add capped-memory".
>
>
>Does that help?






--
--------------------------------------------------------------------------
Jeff VICTOR              Sun Microsystems            jeff.victor @ sun.com
OS Ambassador            Sr. Technical Specialist
Solaris 10 Zones FAQ:    http://www.opensolaris.org/os/community/zones/faq
--------------------------------------------------------------------------
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to