Selva
Selva

Reputation: 839

Java memory usage/repair

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

Upvotes: 1

Views: 400

Answers (3)

Amir Afghani
Amir Afghani

Reputation: 38541

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.

Upvotes: 0

A_M
A_M

Reputation: 7851

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

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

Upvotes: 0

darioo
darioo

Reputation: 47193

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.

Upvotes: 1

Related Questions