OS Version: SunOS <hostname> 5.10 Generic_142900-13 sun4v sparc SUNW,Sun-Blade-T6340
I need some expert guidance on investigating memory usage on Solaris. I want to know whether am interpreting the output from ps -efl correctly and whether the command top is showing the right information or not. Details of the problem is as below:
- top command reported free memory from this server is at 226MB out of 7968M reported. A bit worried that the server may run out of memory and start swapping. So far, for a week now, top reports no swapping so not that worried at this stage.
- The top command memory usage per PID does not seems correct and is exceeding the 7968M available RAM, so we used ps -efl instead and the SZ column from running that ps command seems to match with the reported memory usage.
- From the ps -efl output, the memory usage seems to be constant at 115M more or less, is there a server/kernel/database setting that sets minimum memory usage to start at 115M per process? This seem to be the case for oracle processes but can't find anything on the database settings that suggest this is getting set in the database ...
- Any advise on how to troubleshoot this problem will be very much appreciated. Thanks in advance.
Several useful output information can be found below:
Output from "echo ::memstat | mdb -k" as below. I am hoping I can match up the output below with the ps -efl output somehow but not sure how to do that.
The server is used by a third-party application using JAVA and is also used as an Oracle database server. - ps -efl output from application connections as below. Based on the ps man pages, the SZ column is the memory usage in KB, is that correct, so that means from the output below the first process below is using 115005KB, roughly 115MB of memory, is that correct?
- ps -efl output for Oracle database processes as below. I assume I can't control the memory usage on these processes as they are spawned by Oracle.
- Excerpts from top ordered by SIZE. The output seems doubtful. From the output below, it shows each oracle PID consuming 800M of memory and I only have 7968M, how come? Should I discard these information and rely on the output from ps -efl then which seems to be the correct one?
- ps -efl output from Non oracle processes as below:
- top command reported free memory from this server is at 226MB out of 7968M reported. A bit worried that the server may run out of memory and start swapping. So far, for a week now, top reports no swapping so not that worried at this stage.
"top" isn't part of the OS. It is known to report confusing data as it doesn't use always the same terminology as Solaris does. Better to avoid it and use prstat, vmstat, "swap -s" and the likes.
Quote:
- From the ps -efl output, the memory usage seems to be constant at 115M more or less, is there a server/kernel/database setting that sets minimum memory usage to start at 115M per process? This seem to be the case for oracle processes but can't find anything on the database settings that suggest this is getting set in the database ...
There is hopefully no minimum memory usage kernel tuning per process. I would guess this is simply due to shared memory accounted to each process.
Quote:
- Any advise on how to troubleshoot this problem will be very much appreciated. Thanks in advance.
What problem do you want to troubleshoot ? You tell there is no swapping reported so IMHO nothing to fix. You have plenty of available memory (most of the ZFS file data is available to applications should they need it) and anyway, unused memory is wasted memory.
"top" isn't part of the OS. It is known to report confusing data as it doesn't use always the same terminology as Solaris does. Better to avoid it and use prstat, vmstat, "swap -s" and the likes.
Hi,
I totally agreed with what you noted so I will stick to the known reliable generic commands of vmstat, prstat etc. I got some more questions below, if you don't mind ...
Quote:
There is hopefully no minimum memory usage kernel tuning per process. I would guess this is simply due to shared memory accounted to each process.
What problem do you want to troubleshoot ? You tell there is no swapping reported so IMHO nothing to fix. You have plenty of available memory (most of the ZFS file data is available to applications should they need it) and anyway, unused memory is wasted memory.
- Again, totally agreed, no swapping = no problem = nothing to fix. And you are right, unused memory is wasted memory, it's like why worry about 90% CPU used as long as it is a valid not for aethestic reason, i.e. looks good/bad on the graph
- In saying that, what am mainly wanting to achieve I suppose is whether the reported memory usage from ps -efl column is correct or not. If I sum up the values under the SZ column and the total is less than the total RAM on the server, does that mean, swapping is not happening. Will there be a case where the sum of the SZ column is greater than the total RAM on the server in which case, that should mean swapping is happening? BTW, is it possible to get total memory usage using the ps command ... ... am currently doing this via an awk script.
- You said "You have plenty of available memory (most of the ZFS file data is available to applications should they need it)", how are you able to tell that it is available or unavailable? Am presuming you are getting this info from the"echo ::memstat | mdb -k". Doesn't the output from that mean used/allocated memory by "ZFS File Data" rather than whether it is available/unnavailable memory or is that a wrong assumption? Can you please explain further?
- The "no swapping" conclusion is from the top command so without using top, my vmstat output is as below, po is zero (0) so that confirms that swapping is not happening.
- In saying that, what am mainly wanting to achieve I suppose is whether the reported memory usage from ps -efl column is correct or not. If I sum up the values under the SZ column and the total is less than the total RAM on the server, does that mean, swapping is not happening.
Likely, but not necessarily.
Quote:
Will there be a case where the sum of the SZ column is greater than the total RAM on the server in which case, that should mean swapping is happening?
Possibly but not necessarily.
Quote:
BTW, is it possible to get total memory usage using the ps command ... ... am currently doing this via an awk script.
"ps" doesn't do aggregation. You might want to use "prstat -Z" to get that kind of statistics. Beware that kernel RAM usage isn't reported by ps or prstat as the kernel isn't a process, at least not a regular one.
Quote:
- You said "You have plenty of available memory (most of the ZFS file data is available to applications should they need it)", how are you able to tell that it is available or unavailable?
Because that's by design. ZFS is the only file system I know that reports its cache as used memory. Other file systems report the equivalent as free memory. This is confusing a lot of ZFS users.
Quote:
Am presuming you are getting this info from the"echo ::memstat | mdb -k". Doesn't the output from that mean used/allocated memory by "ZFS File Data" rather than whether it is available/unnavailable memory or is that a wrong assumption? Can you please explain further?
A large part of it is, as I just wrote, available to process for allocations so is really free memory.
Quote:
- The "no swapping" conclusion is from the top command so without using top, my vmstat output is as below, po is zero (0) so that confirms that swapping is not happening.
Better to watch vmstat "sr" column, as long as it stays equals or close to zero, there is no worry to have about swapping.
One of my Solaris Unix server has total RAM 128G . top & vmstat command shows free memory is 86G and usage is 42G.
ps -eo pid,rss,commshows memory usage by process. when i sum all the memory usage by the process, it shows 1.9TB as shown below.
$ ps -eo pid,pmem,vsz,rss,comm | sort -rnk2 |... (5 Replies)
Hi guys,
I got an issue today with one of my servers. The guy is reporting by top only 1.8 available Gig for physical memory.
I see my processes and they don't even get to 15Gigs, I have 64 physical Gigs.
Details
Memory: 64G phys mem, 1820M free mem, 32G total swap, 32G free swap
I have... (4 Replies)
Hi,
Yersterday I started monitoring my homeserver memory consumition due some errors found in the system (network hangs). I've detected almost all the memory used (~10 MB free from 1GB).
First I thought it was because of the MySQL configuration, so I monitored it with top and found it wasn't... (6 Replies)
Hi All,
We have a server with Solaris 10 installed. The total memory of the server is 64GB. In order to check the memory info of the server I use "top" utility that gives me total and free memory in real-time.
I have also installed a Sun container (non-global zone) on top of parent operating... (4 Replies)
Hi all,
Is it possible to get total memory usage and free memory usage without top? By Googling I found for total memory usage, use vmstat, for CPU, use mpstat, for disk I/O use iostat, is this correct? Will using sar gives the same result as ALL of these three (3) commands?
What about if I... (2 Replies)
Hi all,
I have a server running an Oracle database that is part of a Solaris M5000 container. Presumably this is referred to as a zone within a cluster, not sure if I get the terminology right.
Anyway, a third-party manages the zone and unfortunately is not "helpful/friendly" to assist me on... (1 Reply)
Hi,
I'm running a multi-process software system on a Solaris 8 machine. When I monitor the memory usage, I see that the free memory is dropping rapidly, but I can't detect a process that uses this memory.
I'm using "top" to get the free memory and the memory usage of processes.
Thanks. (3 Replies)
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Hello all
im working on sunos machine that dont have the top installed and can't be
install , now i need to get information similar to what top gives me about the cpu usage and so
can it be done somehow else where ? (3 Replies)
in unix when i use top
i get an output like this:
load averages: 0.64, 0.57, 0.53 14:04:42
347 processes: 1 running, 1 waiting, 169 sleeping, 172 idle, 4 stopped
CPU states: 16.4% user, 2.8% nice, 7.6%... (2 Replies)