I’ve got a Java web app (WAR) deployed to Tomcat on a remote Solaris machine that is throwing IOExceptions claiming “Not enough space”. After spending several days painfully researching the issue, I see that I have some process forking going on in my code that requires Solaris to place both parent/child processes in the system swap space, and every now and again there is not enough swap space to contain both processes. Here is an article that explains what is happening more eloquently/intelligently than I can. But its definitely the culprit.
So I need to put in a ticket with our systems admin to increase swap space, but I’m stuck trying to figure out how much space I need. I can use JConsole to profile memory usage on the server, but on the VM Summary tab the swap space used/available info seems to only get read when JConsole starts up and does not refresh. This prevents me from using JConsole to see real-time swap usage while I reproduce this forking/memory issue.
The only server monitor I have access to is something called prstat (I’m used to top and nmon).
I need to give systems a specific number (ie. Please increase myserver.net’s swap space by 250M, etc.). How can I obtain this number? The server is running on Java 1.6u25 so maybe there are some Java tools I’m not aware of, or perhaps some Solaris profilers/monitors I might be able to use.
It would help if you provide more information like the current RAM and swap size, the number of JVMs running, their heap size and virtual memory usage and the expected level of concurrency of these forking processes.
prstat -Zoutput would also help.In any case, you can monitor you virtual memory usage with the
swap -scommand and make sure the last value (…k available) is always large enough.Note that despite a common belief, there is no problem at all having too large a swap so I would suggest simply doubling you current swap area size as a first approach.
You got the current swap area size with the
swap -lcommand.Here is an article about Solaris application memory management that might also help.