Memory Accounting, JDKs [was: Re: [Techtalk] Java on Linux]

Kathryn Hogg kjh at flyballdogs.com
Thu Jan 10 19:36:00 EST 2002


> This is what I'm doing right now (they all report the same value) and
> it doesn't seem right.
>
> Server = 254M
> Client = 226M
> GUI    = 205M
>
> System reports: 243M memory used, 6M free

Most modern Unixes go to some lengths to share memory pages and defer making
copies of pages until needed (copy on write). The binary, shared libs, etc
all start out using the same pages in the VM but a process gets it's own
copy of the page when you modify it.  ps and friends typically end up
counting these shared pages once per copy.  According the algorithms
specified before, you should have started out with your system reporting N
MB of VM free.  If your numbers were correct then when you started your
Server, it should have dropped to N - 254.  After the client, it should have
been N - 254 - 226, and similarly for the GUI

Is the 243M memory used reported the real memory or virtual memory?  You
probably want to be dealing in terms of virtual memory only for this
exercise.

--
Kathryn





More information about the Techtalk mailing list