tags:

views:

164

answers:

2

Hi everyone!

My eclipse sometimes starts using 100 % of my CPU very spontaneously. I can't figure out why it needs that much CPU usage. There is no background task like "building workspace" running.

After some time the CPU load drops to 0 and everything is normal.

I can't find any information related to the problem in workspace/.metadata/.log file.

Has anybody some tip how i can figure out which part of eclipse is using the CPU so heavily? Is there a way to get a thread dump of eclipse? The kill -3 on the eclipse process doesn't do anything.

Eclipse Version: Galileo JavaEE
Operating System: Linux 2.6.31

Thanks in advance!

Florian

+1  A: 

Sounds like garbage collection

You could try changing the settings in your eclipse.ini, maybe with a higher Xmx value

--launcher.XXMaxPermSize
256m
-vmargs
-Xms256m
-Xmx1024m
-XX:PermSize=64m
-Xss1M
-server
-XX:+DoEscapeAnalysis
-XX:+UseConcMarkSweepGC
stacker
Turning on the General preferences option "Show heap status" can also help to determine whether garbage collection is the cause.
Stephen Denne
I already started eclipse with a lot of memory (permsize 128 mb and 1024 mb heap). Also the cpu usage is up to 100 % for too long if it only were garbage collection.
Florian Gutmann
+1  A: 

You can use visualvm to profile eclipse, get a heap dump or a thread dump, see which threads are running, etc.

Stephen Denne
Wow! I didn't know visualvm before it looks very promising and i think i got a hint to the right direction. Thanks a lot!
Florian Gutmann
@Florian were you able to determine what was using the CPU?
Stephen Denne
I thought so, but later found out that it wasn't the php plugin. But now i have a good tool to track down the issue.
Florian Gutmann
Finally i could really track it down. Now I'm 99% sure what causes the load. It's a regular expression invoked by `org.eclipse.ui.internal.console. ConsolePatternMatcher$MatchJob.run(ConsolePatternMatcher.java:127)`. When i tried to clear the console output eclipse got totally unresponsive. I will try to collect some more information about the issue (like the console output) and go for the eclipse mailing list. Thanks again Stephen!
Florian Gutmann