-1

We have a Java application and jdk is 7up75...Xms set is 1 GB and Xmx is 3 GB. We use JConsole to monitor JVM and we found that JVM usage is keep on increasing...We enabled GC and GCInterval is 30 minutes..During weekends application is used by 1-2 users, but still when we check the JVM usage on Monday morning, we can see almost same or higher JVM usage than in Friday evening. Currently we are facing out of memory error in every 1 week. Started facing this issue for last month only. Same system was working fine for last 2 years without any issues.. Now DB is almost doubled... Can any one give any hint or suggestions please..Thanks in advance..

Shame
  • 23
  • 1
  • 2
  • 1
    Sounds like you have a memory leak. With what you've provided there's surely nothing else anyone could tell you. You might as well call up a mechanic and say "My car isn't working right, what's wrong?". – dimo414 Apr 30 '16 at 02:50
  • 1
    its time for heap dumps and eclipse memory analyzer – radai Apr 30 '16 at 02:53
  • Dimo414 and Radai.... Thanks ..I wonder if memory leak is the issue, why system ran for two years without any heap error....Also currently both APP and DB server is in same machine...8GB RAM and 4 core cpu..what if we split DB into another server?..... – Shame Apr 30 '16 at 03:34
  • @Shame with what you've given us to go on anything's possible. "Wondering" about a system we can't see or inspect isn't going to get us anywhere. Ask a concrete question and you'll get concrete answers. Until then we can only offer blind conjecture. – dimo414 Apr 30 '16 at 04:58

1 Answers1

1

As the comments say, this sound like the classic symptoms of a memory leak. Before you spend time looking for other possible causes (with no evidence for any particular cause) you would be advised to use a memory analyser to see if the memory leak theory is valid.

..I wonder if memory leak is the issue, why system ran for two years without any heap error.

That doesn't mean it isn't a memory leak.

The only thing we can say with any confidence is that something has changed. That something could be be lots of things:

  • changes to the software or libraries,
  • changes to the JVM,
  • changes to the amount of information in your system (e.g. in-memory information),
  • changes to the way you / your users are using the system
  • other things that I haven't thought of.

Also currently both APP and DB server is in same machine...8GB RAM and 4 core cpu..what if we split DB into another server?

That won't alter the memory usage of your JVM. It might allow you to run your JVM with a larger heap, but if the problem is (as we suspect) that you have a memory leak, then increasing the heap size is like putting a bandaid on infected wound. It doesn't solve the real problem. The patient still dies.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Thanks Stephen C for a details reply...can you please elaborate how can I analyse the memory leak...can you please suggest some best tools/software and way to analyse...Thanks in advance.... – Shame Apr 30 '16 at 04:07
  • also as you told, we have changed the JVM...previously it was 32 bit jdk6u24 and 3 months back we updated to 64 bit jdkup75....No.of concurrent users also increased for last 3-4 months...before the con usage was 30-40, not its 60-70....Any hint...? – Shame Apr 30 '16 at 04:19
  • also as you told, we have changed the JVM...previously it was 32 bit jdk6u24 and 3 months back we updated to 64 bit jdkup75....No.of concurrent users also increased for last 3-4 months...before the con usage was 30-40, now its 60-70....Any hint...? – Shame Apr 30 '16 at 04:23
  • 1
    The specific changes are not relevant. The fact is that things >>have<< changed in the last 2 years. Any of those changes >>could<< have introduced a memory leak, or exacerbated a memory leak that was there all along. Your reasoning that it can't be a memory leak is without foundation. That was the point I was making – Stephen C Apr 30 '16 at 04:33
  • There are any number of possible tools for finding memory leaks. Start with the tools that are supported by your IDE and plugins. Or read this: http://stackoverflow.com/questions/40119/how-to-find-a-java-memory-leak – Stephen C Apr 30 '16 at 04:34
  • @Shame I would start with the memory profiling tools which are built into the JVM. – Peter Lawrey Apr 30 '16 at 06:38