Find it

Monday, March 8, 2010

Solaris mdb debugger tool & memstat information.

 Mdb is a good debugger tool in Solaris. We had an issue with one of out production Oracle DB server. The issue was with excessive memory usage so using mdb we easily figure out who is using how much memory. So using mdb we easily figure out who is using how much memory & it helped us to at least figure out what causing the performance bottleneck.

# mdb -k
Loading modules: [ unix krtld genunix md ip ipc usba ptm cpc random nfs ]
> ::memstat
Page Summary Pages MB %Tot

------------ ---------------- ---------------- ----

Kernel 868241 6783 11%

Anon 7077614 55293 88%

Exec and libs 7308 57 0%

Page cache 8933 69 0%

Free (cachelist) 131769 1029 2%

Free (freelist) 18446744073709539318 17592186044319 0%
Total 8081567 63137

Where kernel indicates, system memory usage by kernel. Anon indicates that of anonymous memory.

What is anonymous memory?

Anonymous memory refers to pages that are not directly associated with a vnode. Such pages are used for a process's heap space, its stack, and copy-in-write pages.
Exec and libs indicates executable/shared library paging.

Next it shows page cache. The page cache is used for caching of file data for file systems other than the ZFS file system. The file system page cache grows on demand to consume available physical memory as a file cache and caches file data in page-size chunks. Pages are consumed from the free list as files are read into memory. The pages then reside in one of three places: the segmap cache, a process's address space to which they are mapped, or on the cache list.

Freelist and the cache list hold pages that are not mapped into any address space that have been freed by page_free(). Though pages in the cache list are not really free, they still contain a valid vnode, offset pair and are a valid cache of pages from files. But pages in the free list are not associated with any vnode, offset pair. Pages are put on a free list when a process using those pages exit.

Hope this will help.