Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a CentOS virtualized server and I just installed Jira. I'm having trouble understanding what is going on with the Sun JVM whenever Jira is running. Java's max heap size is set to 384MB but the Java instance is taking up well over 1GB.

I'm new to linux server administration but I understand that their is additional overhead to the JVM and that process memory reporting isn't always accurate (especially with threads, which I believe Jira uses heavily), but I assume free -m gives a more accurate picture of total memory usage. Comparing the system memory with and without Jira tells me it is using over 1GB. I only have 1GB of physical ram and 768 swap/virtual.

When I use vmstat it says I have not had any virtual pages but I probably should be. I'm worried that I'm only running one process and my server is already maxed out. How can I be sure that my system is (or could be) on its knees because of resource usage?

Thanks.

share|improve this question
1  
Run pmap -x <PID> to see how much memory it is eating. –  quanta Sep 13 '11 at 17:01

1 Answer 1

up vote 2 down vote accepted

Okay - there are a few things to keep in mind. First, in modern Linux kernels, threads are simply processes that share a few resources and flags, most notably, address space. So yep, threads in the output of something like 'top' can make things pretty confusing. Example: Our Oracle server has about 30 threads running simply appearing as 'oracle' - they each show up as consuming 38 GB of ram. Pretty amusing on first glance.

Ok - the suggestion in the comment above is spot on the money. Use 'pmap' to see exactly not just the memory consumption of the process, but the breakdown of that memory usage. The shared library entries (.so) entries aren't much to worry about. Your real concern is the [ anon ] entries and the [ stack ] entry. See if you can get a total of those. That will give you the honest picture of how much non-shared memory the process is consuming.

share|improve this answer
    
Thanks quanta and Larold, that helped me nail down the memory usage. But now I know that Java is using a ton of memory and I have no idea why. –  SomeWritesReserved Sep 14 '11 at 22:51
    
Well, that could be for a number of reasons. I'm not an expert, but if we're talking JVM, that's going to have a whole slew of internal data structures for housekeeping. If you're running an app that is data-intensive, or has a memory leak, then you'll get massive memory usage that way too. (Yes, memory leaks ARE possible in Java: java.dzone.com/news/how-fix-memory-leaks-java) There are also good profiling tools out there - look them up and you should find one you like. Good luck! –  Larold Sep 15 '11 at 1:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.