3

Am working on a Java application which developed in Java 5. We are trying to update it to Java 6 so we have started using Jdk1.6. It runs 24 hrs we have not schedule any timely bounce for this application.

This is a thread based application in all 92 threads run fetching messages from MQ queues to insert the data in Oracle tables.

my question is we sometimes get Out of memory error in Java 6 .. is this because we should timely bounce the application once in week/month? or we should check for any memory leaks in the code?

Just curious to know is GC enough to run application long time or restart is always needed?

AmitN
  • 73
  • 3
  • 12
  • 4
    `is this because we should timely bounce the application once in week/month` No. You should fix it... Get heap dumps using jmap -dump, and see what's going on with Eclipse Memory Analyzer. `Just curious to know is GC enough to run application long time or restart is always needed?` No restart should be needed. A well-groomed application, even high-profiled should be able to run forever... – ppeterka Mar 05 '13 at 13:19
  • @ppeterka that is what I believed in that java application should run without such issues.. I tried to check using JConsole as this is on linux servers having hard time to analyze using that.. will surely take the dump to analyze it. – AmitN Mar 05 '13 at 13:26

1 Answers1

0

The GC is fine to run for long periods. You either have a memory leak, or your application by it's nature happens to use more heap space than the Java VM is allowing.

You can try running your app with -Xmx1g or something like it to give your application more heap space.

Community
  • 1
  • 1
Collin
  • 11,977
  • 2
  • 46
  • 60