Manoj
Manoj

Reputation: 271

Why I am getting OutOfMemory exception in Eclipse?

I am trying to open a workspace in eclipse , as soon as it open the workspace throws below exception:-

!ENTRY org.eclipse.core.resources 2 10035 2012-01-03 20:55:15.212

!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.core.jobs 4 2 2012-01-03 20:55:29.345 !MESSAGE An internal error occurred during: "Requesting Java AST from selection". !STACK 0 java.lang.OutOfMemoryError: Requested array size exceeds VM limit at org.eclipse.jdt.internal.core.index.DiskIndex.readHeaderInfo(DiskIndex.java:787) at org.eclipse.jdt.internal.core.index.DiskIndex.initialize(DiskIndex.java:389) at org.eclipse.jdt.internal.core.index.Index.(Index.java:97) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getIndex(IndexManager.java:253) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getInde

I tried to increase the memory , tried to use latest eclipse indigo but it throws the same error. Can somebody help me how should I resolve this error?

Thanks, Manoj

Upvotes: 2

Views: 5738

Answers (2)

Gangnus
Gangnus

Reputation: 24484

The ini file won't help for the virtual machine. Set VM arguments instead, as here

Upvotes: 0

Eldar Abusalimov
Eldar Abusalimov

Reputation: 25533

How exactly did you increase memory?

Try to play with -Xms and -Xmx that refer to the heap size available for Eclipse. Also sometimes increasing -XX:PermSize and -XX:MaxPermSize (permgen) values helps too.

For example, here are the values from my eclipse.ini (having 8GB total RAM):

...

-vmargs
-XX:MaxPermSize=2048m
-Xms320m
-Xmx3072m

...

Upvotes: 1

Related Questions