1

We are using a java application which is based on RMI.When we run the application the memory usage keep on increasing even though the the application is ideal stage.We are mainly using Vector and hash map data structure.how to minimize the java memory usage/repair memory leakage?

Thanks in advance

Milen A. Radev
63.2k22 gold badges111 silver badges112 bronze badges
asked Dec 8, 2010 at 11:50
6
  • You need to do some root cause analysis of where your memory leak is coming from. What JDK are you using? Commented Dec 8, 2010 at 11:52
  • Try take memory snapshots with JProfiler (or any other memory profiler) and compare them. You'll clearly see where memory is going. Commented Dec 8, 2010 at 12:11
  • I am using j2sdk1.4.2_18 Commented Dec 8, 2010 at 12:12
  • 1
    How are you measuring memory usage? Are you looking at the process (through tools such as ps or the Windows Task Manager), or are you looking at Java heap usage? Commented Dec 8, 2010 at 12:19
  • Using Windows Task Manager,is it right way?how to view the java heap usage? Commented Dec 8, 2010 at 12:22

3 Answers 3

1

If you can't upgrade your JDK version, I suggest testing your application on another machine (real or virtual) with the latest 1.6 JDK, and then use the built in jvisualvm which is a really great tool for diagnosing problems like this.

answered Dec 8, 2010 at 12:20
Sign up to request clarification or add additional context in comments.

Comments

0

I'd start with trying to understand Java's memory model.

Here's a stackoverflow question (858250) with lots of links explaining.

answered Dec 8, 2010 at 12:50

Comments

0

Since you're using 1.4.2, and you can't use jmap or visualvm, I'd suggest running your Java process with:

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="foo.out"

and after it runs out of memory, open foo.out with HPjmeter. This should help you identify the objects ballooning in your application.

answered Dec 8, 2010 at 16:37

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.