On 04/18/12 16:57, Mike Gerdts wrote:
> On 04/18/12 16:42, Jordi Espasa Clofent wrote:
>> El 2012-04-18 19.22, Hung-Sheng Tsao (LaoTsao) Ph.D escribió:
>>> may be one could add
>>> in solaris resource control used to be project based
>>> one need to setup project and limit the resoure pool
>>> then assign the poll to zone.
>>> it is not easy to use .
>>> since then many shortcut for resource pool control are added to zonecfg
>>> make it very easy to add resource control inside the zone
>> The cuestion sill, more or less, there: It is possible to limit the amout of
>> that a zone can borrow from the global zone without rcapd?
>> As far as I can understand, if a zone only uses zone.max-shm-memory instead,
>> potencially can borrow all the available RAM. So?
> zone.max-swap can be used to limit the amount of memory that processes in a
> can reserve. Note that this has little to do with swap devices - the term
> in this sense means virtual memory.
> In order for a process to use RAM, those pages of RAM need to be backed by
> something that can be paged. Anonymous pages (those typically obtained via
> malloc()) are charged against malloc. The memory needed to hold executables
> libraries are backed by the disk where they reside.
I received a reply off-list that made me realize I misstated things a bit.
Every reserved page of memory needs to have backing store. That backing store
can be RAM, files on disk, memory mapped files, and perhaps somewhat less common
backing stores (frame buffer memory?). Virtual memory (swap) is reserved as a
result of system calls like brk() and sbrk() which is where malloc() gets its
memory from. Also, when a process forks, pages that are read-write but not
shared also reserve more memory.
You can run a Solaris system without swap devices but that system will still
have virtual memory (swap) - this helps accentuate the confusing and overlapping
meanings of swap. When running without swap devices, the system will be
unlikely to be able to use all of its available RAM because all reserved
anonymous pages (many which may never be needed) will be backed by RAM.
Solaris Core OS / Zones http://blogs.oracle.com/zoneszone/
zones-discuss mailing list