Understanding prstat

Hello
We have a SPARC box running Solaris 10. We have 32 GB of physical memory, 32 GB of swap. Now i want to monitor memory usage for performance tuning. The box is running Sybase database. When I type prstat i get the following

  PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
 16736 root      155M   11M sleep   59    0   0:50:08 1.7% java/50
 20973 sybase15   20G   14G sleep   60    0  13:29:25 1.5% dataserver/248
 21039 sybase15   20G   14G cpu17   31    0  12:10:08 1.4% dataserver/136
 21037 sybase15   20G   14G sleep   52    0  13:02:50 1.4% dataserver/264
 19546 sybase15   20G   14G sleep   58    0  31:49:14 1.2% dataserver/205
 20976 sybase15   20G   14G sleep   60    0  14:23:36 1.0% dataserver/114
 21042 sybase15   20G   14G cpu22    0    0  13:15:58 1.0% dataserver/264
 20986 sybase15   20G   14G cpu14   32    0  14:56:42 1.0% dataserver/204
 20967 sybase15   20G   14G sleep   60    0  15:36:49 1.0% dataserver/110
 21043 sybase15   20G   14G sleep   52    0  15:23:22 0.8% dataserver/264
 21040 sybase15   20G   14G sleep   59    0  12:51:42 0.8% dataserver/264
 20966 sybase15   20G   14G sleep   59    0  14:24:24 0.8% dataserver/264
 20964 sybase15   20G   14G sleep   55    0  16:36:37 0.8% dataserver/260
 20963 sybase15   20G   14G sleep   60    0  19:20:25 0.8% dataserver/264
 21038 sybase15   20G   14G sleep   59    0  12:49:25 0.7% dataserver/238
 21031 sybase15   20G   14G sleep   55    0  11:38:24 0.7% dataserver/168
 20979 sybase15   20G   14G sleep   52    0  13:52:33 0.7% dataserver/246
 21001 sybase15   20G   14G sleep   53    0  11:48:09 0.7% dataserver/185
 20965 sybase15   20G   14G sleep   54    0  16:04:59 0.6% dataserver/264
 21036 sybase15   20G   14G cpu29    0    0  12:54:52 0.5% dataserver/264
 12795 root      204M   32M sleep   59    0   0:02:51 0.5% java/58
 20971 sybase15   20G   14G sleep   54    0  14:41:37 0.4% dataserver/190
 20968 sybase15   20G   14G sleep   59    0  15:00:17 0.4% dataserver/216
 20981 sybase15   20G   14G sleep   54    0  14:24:49 0.3% dataserver/264
 21022 sybase15   20G   14G sleep   59    0  13:15:45 0.2% dataserver/217
 20984 sybase15   20G   14G sleep   58    0  15:01:33 0.2% dataserver/95
 21029 sybase15   20G   14G sleep   59    0  12:30:07 0.2% dataserver/232
 21034 sybase15   20G   14G sleep   59    0  12:26:57 0.2% dataserver/129
 21041 sybase15   20G   14G sleep   59    0  13:50:25 0.1% dataserver/253
 21007 sybase15   20G   14G sleep   59    0  15:22:16 0.1% dataserver/131
 19547 sybase15   11G   11G sleep   59    0  21:13:00 0.0% dataserver/264
     4 root        0K    0K sleep   60    -  95:59:52 0.0% cluster/1198
  2377 root      148M 4328K sleep   59  -20  31:43:38 0.0% perfd/3
  2596 root       34M 6472K sleep   59    0   5:08:10 0.0% opcmsga/12
  2230 root      143M 2872K sleep   60    0  30:18:21 0.0% scopeux/1
  2588 root       69M 2992K sleep   59    0   3:15:11 0.0% coda/8
  1760 root       63M 1304K sleep  101    -   9:22:36 0.0% rgmd/44
     8 root       20M 9936K sleep   59    0   0:32:40 0.0% svc.startd/14
 20406 sybase15   11G   11G sleep   59    0  13:43:42 0.0% dataserver/264
 20419 sybase15   11G   11G sleep   59    0  15:59:13 0.0% dataserver/264
 20408 sybase15   11G   11G sleep   59    0  14:14:08 0.0% dataserver/264
Total: 366 processes, 11897 lwps, load averages: 7.98, 7.14, 5.68

What i don't understand is: I have over a dozen processes each having an RSS of 14G how can that be possible if the total memory i have (physical + swap) is only 64GB?
Another thing, when i run prstat -a to see the summary I have memory consumption about 36% which i think is pretty misleading.
So how do i interpret the output of prstat, how can i know whether or not i am using SWAP space because this will definitely degrade the DB performance and pushes us towards the direction of upgrading memory?

check this link

That's because of shared memory which is accounted for each process using it.

Why do you thing it is misleading ?

prstat is not the the right tool to use if you want to know if pagination occurs because of RAM exhaustion. You should instead have a look to vmstat output, especially the free and sr columns. swap -s and swap -l would also help.

1 Like

Could you please shed some light on that "shared memory" thing because i don't fully understand this term. Does it mean that memory is allocated to whatever process is needing it and when when other processes need this memory they are kept in the queue until free? and does that affect performance?

More or less. That's areas of memory which instead of being privately owned by processes like regular ones, are, by program design, shared by various processes.

In the sense it improve performance, being faster than any other communication method, it does indeed.

1 Like