On Fri, Jul 4, 2008 at 11:18 AM, Frank Mancini <[EMAIL PROTECTED]> wrote: > Quick question. On my server, I have: > > 16 gigs of real memory > 5 gigs are free > > 32 gigs of swap > 28 gigs of swap used > > > Doesn't memory fill the real physical first and how come I'm using so much > swap?
When an application asks for memory a "swap reservation" is performed. This reservation is immediately seen in the swap column of vmstat. In this context, "swap" means the combined space of RAM and swap devices. Since none of the memory has been touched yet, there is no reason to reserve RAM for it - in fact there is a pretty good chance that some of it will never be touched before the process exits. An example of where I have seen this is when some application manual says to set the java heap size (-xMx) to X GB, but the application running in the JVM never touches much of that. As soon as java starts, a bit more than X GB of memory is reserved but a small fraction of it is touched - free swap is decreased but free RAM remains mostly constant. As the application uses memory that is reserved the free swap remains constant and the free RAM decreases. -- Mike Gerdts http://mgerdts.blogspot.com/ _______________________________________________ opensolaris-discuss mailing list [email protected]
