Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 464928

Summary: Eclipse freezes and eventually crashes while opening java class
Product: [Eclipse Project] JDT Reporter: Joris Kinable <j.kinable>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, loskutov, sasikanth.bharadwaj, stephan.herrmann
Version: 4.4.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
.metadata/.log
none
JVM dump log 1
none
JVM dump log 2 none

Description Joris Kinable CLA 2015-04-18 06:43:05 EDT
Created attachment 252505 [details]
.metadata/.log

I'm developing a java project. Unfortunately, eclipse (version: Luna Service Release 2 (4.4.2)Build id: 20150219-0600) decided to crash when I was working on a specific java class.

Symptoms: when opening the class for editing, CPU ramps up to 100%. When left for about 5 minutes, eclipse crashes with "An internal error occurred during: "Compacting resource model". GC overhead exceeded."

Without this specific class file, the project works fine. It's a relatively small project (<50 files), so nothing out of the ordinary there. When I open the file in a separate project (without all its dependencies) it works fine as well). My eclipse ini:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms1024m
-Xmx1024m

Attached you'll find a snippet of my .log file
The file causing the problem: BranchAndPrice.java, available here: https://github.com/jkinable/jorlib/blob/development/jorlib-core/src/main/java/org/jorlib/frameworks/columnGeneration/branchAndPrice/BranchAndPrice.java
The complete project is available here: https://github.com/jkinable/jorlib/tree/development

Some of the commonly mentioned steps I tried to resolve this issue:
-moving org.eclipse.core.resources, restarting eclipse, moving the files back
-starting a new fresh project
Comment 1 Andrey Loskutov CLA 2015-04-18 06:45:44 EDT
Please create JVM dump at the time CPU is fully loaded.

$jps -l
123123 sun.tools.jps.Jps
424242 /opt/eclipse/plugins/org.eclipse.equinox.*

$jstack 424242 > JVM_dump.log
Comment 2 Andrey Loskutov CLA 2015-04-18 06:55:44 EDT
Btw your error log shows: java.lang.OutOfMemoryError: GC overhead limit exceeded
Try to increase heap to 4GB: change your eclipse.ini from -Xmx1024m to -Xmx4g - will it help? But the dump is needed to understand what is causing such high memory consumption.
Comment 3 Joris Kinable CLA 2015-04-18 07:10:06 EDT
Created attachment 252507 [details]
JVM dump log 1
Comment 4 Joris Kinable CLA 2015-04-18 07:10:34 EDT
Created attachment 252508 [details]
JVM dump log 2
Comment 5 Joris Kinable CLA 2015-04-18 07:12:26 EDT
(In reply to Andrey Loskutov from comment #2)
> Btw your error log shows: java.lang.OutOfMemoryError: GC overhead limit
> exceeded
> Try to increase heap to 4GB: change your eclipse.ini from -Xmx1024m to
> -Xmx4g - will it help? But the dump is needed to understand what is causing
> such high memory consumption.

I've tried your suggestion. It doesn't help though:
-eclipse doesn't respond
-my system becomes unusable

As per your request I've added 2 dumps taken sequentially. I hope this helps. Thank you for your effort!
Comment 6 Andrey Loskutov CLA 2015-04-18 07:13:47 EDT
Moving to JDT for investigation. The stack contains lot of org.eclipse.jdt.internal.compiler.lookup.* methods
Comment 7 Stephan Herrmann CLA 2015-04-18 07:25:23 EDT
Similar to bug 456924 with these differences: we don't see a StackOverflowError just a very busy computer, and: we're stuck with PTB and CaptureBinding18 vs. PTB and CaptureBinding in the other bug.

Reproduction using the linked github repo should point us directly to the root cause.

Anyone?
Comment 8 Joris Kinable CLA 2015-04-25 12:35:47 EDT
I've moved the project repository containing the code to reproduce this issue to:
https://github.com/jkinable/jorlib/tree/eclipseBug

The link pointing to https://github.com/jkinable/jorlib/tree/development at the beginning of this thread is no longer valid.
Comment 9 Eclipse Genie CLA 2020-04-11 03:38:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.