Subject: Re: [vserver] Unification and memory usage
From: "Roderick A. Anderson" <raanders@cyber-office.net>
Date: Mon, 02 May 2011 16:09:29 -0700

Gordan Bobic wrote:
> On 02/05/2011 23:14, Roderick A. Anderson wrote:
>> I've got myself confused again. Could someone confirm or deny how
>> unification affects memory usage.
>>
>> I was under the impression that if a unified (hard linked) "program" was
>> started by one guest the code for it went into the text area of memory
>> and any needed data area was allocated from the heap. Then when another
>> guest started the same program kernel-magic happened and basically the
>> same code was used but a new chunk of heap was allocated/used for its 
>> data.
>>
>> I'd like to make a simplified drawing of how the Linux-Vserver way with
>> unification saves memory. Have I got it all wrong?
> 
> I believe the memory unification only applies to the shared memory 
> mmap-ed from hard-linked DLLs. If you have the same glibc unified across 
> all your guests, only one instance of it will be in memory. Unified 
> executables won't save you memory in this way.

Thanks.  This make more sense too.

> What you will gain on all unified files, however, is caching efficiency, 
> as you won't end up with multiple copies of the same file being cached 
> separately.

Again thanks.  Helps a lot.

I'll have to revise my graphic plans but they hadn't gone very far 
anyway once I realized I was confused.  :-)


Rod
--