[performace] Aspect vowen into JDT causes inefective loading of classes from JARs in unrelated java projects
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/3182
Reporter Michal.Grzejszczak
Current config:
Eclipse Galileo 3.5.2, JDT 3.5.2.r352_v20100108...
Mylyn 3.3.2
Scala Eclipse Plugin 2.8.0.r21146-b20100312035748
Although it was happening for some time on older versions.
The problem:
With no Scala projects in workspace I am working on regular java projects and projects with Spring IDE nature all while using Mylyn to track the context. From time to time UI thread gets stuck for about 30-60 seconds making it impossible to work with the IDE. The problem is not easily reproducible although it seems to happen more frequently when there are many compile errors in the openend editor (for instance while practicing test-first).
Investigation into the cause of the problem revealed that it is reading JAR files madly. It seems that it reads one class at a time from all jars on the classpath of project at hand. Eventually I was able to catch a stack trace of the thread and it seems that a certain interaction of Mylyn and Scala modified JDT is causing this. I am attaching screenshots from Eclipse debug session. If any more info would be helpful that I can gather please let me know.
Reporter Michal.Grzejszczak
Current config:
Eclipse Galileo 3.5.2, JDT 3.5.2.r352_v20100108...
Mylyn 3.3.2
Scala Eclipse Plugin 2.8.0.r21146-b20100312035748
Although it was happening for some time on older versions.
The problem:
With no Scala projects in workspace I am working on regular java projects and projects with Spring IDE nature all while using Mylyn to track the context. From time to time UI thread gets stuck for about 30-60 seconds making it impossible to work with the IDE. The problem is not easily reproducible although it seems to happen more frequently when there are many compile errors in the openend editor (for instance while practicing test-first).
Investigation into the cause of the problem revealed that it is reading JAR files madly. It seems that it reads one class at a time from all jars on the classpath of project at hand. Eventually I was able to catch a stack trace of the thread and it seems that a certain interaction of Mylyn and Scala modified JDT is causing this. I am attaching screenshots from Eclipse debug session. If any more info would be helpful that I can gather please let me know.
Leave a comment
on 2010-03-15 20:26 *
By tracImporter
Trac author: Michal.Grzejszczak
Attachment: file:stacktrace1.png
Attachment: file:stacktrace1.png
on 2010-03-15 20:26 *
By tracImporter
Trac author: Michal.Grzejszczak
Attachment: file:variables1.png
Attachment: file:variables1.png
on 2010-03-16 03:58 *
By tracImporter
Trac author: ijuma
CC Change: mlists@…
CC Change: mlists@…
on 2010-03-16 08:11 *
By tracImporter
Trac author: spiros
CC Change: sptz45@…
CC Change: sptz45@…
on 2010-03-16 21:03 *
By
This is a consequence of the Scala tooling needing to examine the contents of class files to determine whether they correspond to Java or Scala source so that, eg., the correct outline view can be displayed in the project explorer. It's intentional that it behaves this way in Java projects even in the absence of Scala sources or projects: we want Scala binary artefacts which are part of Java projects to Do The Right Thing, and that means that we have to know if we're dealing with class files generated from Scala source or not.
The scanning should only be occur if you expand a .jar file, and then only once. This will happen if you click through to definitions in, eg., rt.jar, but I'd taken that as being the worst case, and I haven't found performance to be affected significantly.
Are you seeing this happen more frequently than my description of what's going on would suggest? Also 30-60 seconds really doesn't sound right: what are your Eclipse heap settings and the spec of the machine you're seeing this on?
The scanning should only be occur if you expand a .jar file, and then only once. This will happen if you click through to definitions in, eg., rt.jar, but I'd taken that as being the worst case, and I haven't found performance to be affected significantly.
Are you seeing this happen more frequently than my description of what's going on would suggest? Also 30-60 seconds really doesn't sound right: what are your Eclipse heap settings and the spec of the machine you're seeing this on?
on 2010-03-16 21:31 *
By tracImporter
Trac author: Michal.Grzejszczak
Are you seeing this happen more frequently than my description of what's going on would suggest? Also 30-60 seconds really doesn't sound right: what are your Eclipse heap settings and the spec of the machine you're seeing this on?
This is happening more or less once an hour, it depends on the workload. Always after saving .java file. I did not experience it while expanding JAR files. I use different machines 2-4 cores 3-4GB RAM. Configured heap usually has 0,5 GB although on 1GB it was happening too. But I pay attention not to hit max heap. The last time it happened the heap had just 200 MB allocated out of 256 and hard max was at 512. This is definitely not caused by lack of memory.
On a second thought the problem might lie elsewhere. Next time it happens I will thoroughly debug what Mylyn is doing. I'll get back with findings.
Are you seeing this happen more frequently than my description of what's going on would suggest? Also 30-60 seconds really doesn't sound right: what are your Eclipse heap settings and the spec of the machine you're seeing this on?
This is happening more or less once an hour, it depends on the workload. Always after saving .java file. I did not experience it while expanding JAR files. I use different machines 2-4 cores 3-4GB RAM. Configured heap usually has 0,5 GB although on 1GB it was happening too. But I pay attention not to hit max heap. The last time it happened the heap had just 200 MB allocated out of 256 and hard max was at 512. This is definitely not caused by lack of memory.
On a second thought the problem might lie elsewhere. Next time it happens I will thoroughly debug what Mylyn is doing. I'll get back with findings.
on 2010-03-17 03:03 *
By tracImporter
Trac author: shaberman
I see this fairly frequently as well. I'm running Eclipse classic, so no mylyn getting in the way. Maybe it happens once per open project? I could see that (e.g. I just opened a new project and saw the scan happen). Dunno, I'll pay more attention.
I see this fairly frequently as well. I'm running Eclipse classic, so no mylyn getting in the way. Maybe it happens once per open project? I could see that (e.g. I just opened a new project and saw the scan happen). Dunno, I'll pay more attention.
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)