On Sun, Jul 31, 2005 at 03:42:39AM -0700, Ivan wrote:
| Hi,
| 
| I've noticed that OpenSolaris uses the swap space quite fast even if 700Mb 
Physical Memory is free in my system.

Please define "use": from what tool are you determining this?

Solaris uses a two-phase reserve/commit swap reservation. All
anon memory except MAP_NORESERVE (see mmap(2) man page for an
explanation of that flag) reserves swap space at allocation time.
This is done to allow calls like malloc() to fail synchronously,
ensuring (hopefully) good program behavior, versus the alternative
of having to send a program a fatal signal when there is no physical
memory available at fault time.  The swap space is only committed
when swapfs is requested to push a page out to the swap device.

You can tell if pageouts are happening with vmstat(1M) and can
determine how many KB of swap have been committed with "swap -l"
(see swap(1M)).  The "swap" column in vmstat(1M) is very misleading
because it counts both non-pageable physical memory usage such as
by the kernel as well as swap reserve as "swap".

In general, this is a FAQ that results from (IMO) Solaris' faulty
presentation of swap usage, which is both confusing due to seemingly
contradictory information reported from different tools and over-
complex due to Solaris' VM observability tools exposing too many
implementation details. :(

-- 
Eric Lowe       Solaris Kernel Development              Austin, Texas
Sun Microsystems.  We make the net work.                x64155/+1(512)401-1155
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to