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

Bug 484324

Summary: GC Overhead Limit
Product: [Eclipse Project] JDT Reporter: Stefanie Rademacker <stefanierademacker>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, loskutov, stephan.herrmann
Version: 4.5.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
compiler settings none

Description Stefanie Rademacker CLA 2015-12-14 10:11:53 EST
When using Eclipse Mars (4.5.1) with Java 8 compiler, I get an "gc overhead limit" error while building my workspace. Starting Eclipse with the parameter "-Xmx5632m" fixes the problem, but allocating this amount of memory usage is too much for our working environment (limited to 8GB RAM). The problem occurs when using Linux as well as Windows.
Moreover I tested the maintenance build "M20151125-1000" having the same problem.
In Eclipse Luna it has been enough to grant "-Xmx1024m" for the same project. In both cases the parameter "-Xms512m" is set. The project has a size of 2.7GB.
Using Eclipse Luna is not an option, since it shows compiler errors in our project which Mars doesn't show.
Comment 1 Andrey Loskutov CLA 2015-12-14 16:26:27 EST
Stefanie, few questions:
- can you bisect and to narrow down which milestone or even commit caused the issue? 
- can you reproduce the problem with command line build using ecj compiler?
- are there other builders involved (xtext & Co, C++, some other languages)?
- which compiler settings are used (something special)?
- which Java level you are compiling for?
- you mentioned that Luna compiler had errors with your code - can you be more specific on this?
Comment 2 Jay Arthanareeswaran CLA 2015-12-15 01:14:19 EST
One more question: Do you have lot of generics or Lambda in your code?
Comment 3 Stefanie Rademacker CLA 2015-12-15 08:41:13 EST
Created attachment 258687 [details]
compiler settings

(In reply to Andrey Loskutov from comment #1)
> Stefanie, few questions:
> - can you bisect and to narrow down which milestone or even commit caused
> the issue? 
My Eclipse version has the build id 20150924-1200. I cannot say rather or not this problem occurred in previous releases as well, because I installed Eclipse only in October.

> - can you reproduce the problem with command line build using ecj compiler?
Yes, I can reproduce the problem. I get an "java.lang.OutOfMemoryError: GC overhead limit exceeded".

> - are there other builders involved (xtext & Co, C++, some other languages)?
I only use the Java builder.

> - which compiler settings are used (something special)?
Attached please find my current compiler settings.

> - which Java level you are compiling for?
The compiler compliance level is set to 1.8.

> - you mentioned that Luna compiler had errors with your code - can you be
> more specific on this?
The following code causes the compiler errors:

public class A {

	public void x(int index){
		get(executionParameter("importItems", Iterable.class), index);
	}
	
	public <T> T get(Iterable<T> iterable, int position) {
		return null;
	}
	
	protected final <P> P executionParameter(String name, Class<P> parameterClass) {
		return null;
	}
}

Luna shows an compiler error inside the method x where the get()-method is called which reads as follows: "The method get(Iterable<T>, int) in the type A is not applicable for the arguments (Iterable, int)".
Mars doesn't show any errors at this point. Even when compiling with the console and javac compiler I won't get an error, only one warning: "Note: A.java uses unchecked or unsafe operations."
Using the compiler compliance level 1.7 there aren't any errors either in Mars, or in Luna. 

> One more question: Do you have lot of generics or Lambda in your code?
There are no Lambdas in the code. For so far we only compiled the project with Java 7 (without errors) and now want to go up to Java 8.
Thus there is no Java 8 specific code yet. But we are using many generics.
Comment 4 Stephan Herrmann CLA 2015-12-15 09:07:55 EST
(In reply to Stefanie Rademacker from comment #3)
> The following code causes the compiler errors:
> 
> public class A {
> 
> 	public void x(int index){
> 		get(executionParameter("importItems", Iterable.class), index);
> 	}
> 	
> 	public <T> T get(Iterable<T> iterable, int position) {
> 		return null;
> 	}
> 	
> 	protected final <P> P executionParameter(String name, Class<P>
> parameterClass) {
> 		return null;
> 	}
> }

This class is accepted since 4.5M3, likely pointing towards bug 437444. Doesn't look like a hot track to me.

Does the memory problem also occur in Eclipse 4.5.1 when compiling at compliance level 1.7?
Comment 5 Stefanie Rademacker CLA 2015-12-15 09:43:55 EST
No, the memory problem does not occur at 1.7 in Eclipse 4.5.1.
Comment 6 Eclipse Genie CLA 2020-01-23 15:44:22 EST
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.