开发者

Profiling Eclipse itself in terms of memory usage

I want to profile Eclipse's memory usage and not a program under Eclipse.

I have a small Java GWT program and just loading the Eclipse workspace brings up memory usage to 850m... and when ~1024m is reached, the whole thing crawls to snail pace i.e. unusable.

I have increased to 2048m the heap of Eclipse but somehow Eclipse only seem to be able to use 1024m ma开发者_如何学Cx (I am using open-jdk on Linux Ubuntu 10.10).

Please help!


Profiling the memory usage of Eclipse, is no different from profiling any other Java application.

As long as you have started Eclipse with a JVM capable of providing you with HPROF dumps, you can obtain a dump using the jmap utility that is commonly available with the associated installation of the JVM.

The HPROF dump may later be opened using Eclipse MAT or another dump analyzer. Note: Eclipse MAT supports other dump formats as well, so you are not restricted to the Hotspot JVM alone.

A walkthrough of this process, can be found in this post detailing how MAT was used to analyze the memory usage of Eclipse and pinpoint the memory consumption of the spellchecker plugin.

If you want to perform live profiling, then you have to start the JVM associated with Eclipse with a suitable profiling agent, and then attach the profiler to the Eclipse JVM. Instructions would vary from one profiler to another.


Memory Analyzer (MAT) is YOUR solution.

You just install it, launch it, select the Java process (i.e your eclipse process) you want to profile, and enjoy to hunt memory leaks responsible ;-)

Of course, as Vineet said, your JVM implementation must allow MAT to get an HPROF file (i.e the dump of the JVM memory at a given time).


You should launch eclipse in a command line invoking the jvm, instead of using the exe, this way you can connect to the java process with jvisualvm and monitor/profile memory usage etc.

As explained here run:

java -jar eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar

You might need to change the version number of the jar to suit 3.5.


try start eclipse with this params

eclipsec -vmargs -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜