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
  • 60,241
  • 22
  • 105
  • 110
Selva
  • 839
  • 10
  • 25
  • 40

3 Answers3

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.

darioo
  • 46,442
  • 10
  • 75
  • 103
0

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

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

Community
  • 1
  • 1
A_M
  • 7,693
  • 6
  • 33
  • 37
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.

Amir Afghani
  • 37,814
  • 16
  • 84
  • 124