SUMMARY: Reliably detecting virtual memory shortage

From: Tim Bradshaw <tfb_at_tfeb.org>
Date: Thu Dec 11 2008 - 08:29:38 EST
Thanks to everyone who replied.

There was some confusion about shortage of physical memory, causing  
paging, and shortage of virtual memory - really shortage of available  
address space.  I'm interested in the latter, for systems running 8 or  
later.

The conclusion seems to be that there is no easy way of knowing how  
much VM is available, because the kernel has various caches and  
buffers which it is willing to free under pressure, and which are not  
visible to (for instance) "swap -s" as available memory.  As best I  
can tell this was true in 8 and is still true now.  However ZFS has  
made a large difference, because the ZFS ARC (adaptive replacement  
cache) can become fairly large (hundreds of MB at least).

ZFS ARC information is available via the kstat interface in Solaris  
10, and Someone pointed me at Neelakanth Nadgir's blog, where he  
presents a Perl script which will show information about this.  This  
is here: http://blogs.sun.com/realneel/entry/zfs_arc_statistics, and  
you can use it to see the size of the cache changing.

Given that there must be a mechanism in the system already which  
allows things in the kernel which have large stashes of memory to be  
asked to free them up (they can't magically know that user code is  
trying to make a large allocation), it seems to me it would be  
relatively easy to add support so that they could be asked how much  
they would be willing to free up, and summing these numbers would  
provide a "this is all I can give you" figure, which would provide the  
extra information one needs to know where the hard limit is.   
Something like that would be pretty useful to anyone who does not find  
being woken up at 3AM by some short-of-memory alert which turns out  
almost certainly to be a false positive.

--tim
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Dec 11 08:30:25 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:13 EST