开发者

Java memory usage/repair

开发者 https://www.devze.com 2023-01-29 05:24 出处:网络
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

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 me开发者_C百科mory leakage?

Thanks in advance


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.


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

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消