Bug 71217 - OutOfMemoryError occurs frequently when more than 4500 Java Sources are compiled
Summary: OutOfMemoryError occurs frequently when more than 4500 Java Sources are compiled
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2004-08-02 04:07 EDT by Andreas Heidrich CLA
Modified: 2005-04-07 09:21 EDT (History)
0 users

See Also:


Attachments
Complete .log file compressed (171.41 KB, application/octet-stream)
2004-08-03 10:46 EDT, Olivier Thomann CLA
no flags Details
Log File from a computer with verbose option set (18.99 KB, text/plain)
2004-08-12 04:13 EDT, Andreas Heidrich CLA
no flags Details
Hardcopy of the task managers memory usage tab (51.31 KB, image/jpeg)
2004-08-12 04:15 EDT, Andreas Heidrich CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Heidrich CLA 2004-08-02 04:07:07 EDT
We have more than 4500 Source Files that are spread over <20 Projects. Projects 
have a lot of circular dependencies (we set this to warning level to enable 
compile). Once you have a "compiled state", everything is fine. But when you 
try to rebuild the whole workbench from CVS (i.e. on a new maschine) or when 
you do a Project-clean-clean all projects, the compilers runs into 
OutOfMemoryErrors. Only solution is to close several projects (which is 
difficult because of he dependencies) and try to build/clean the rest of it. 
Once you have reached a stable compile state everything runs fine until the 
next Compile that requires a full clean.

We have this behaviour on several maschines. All maschines are Pentium 4 with 
2.8 GH and 1GB RAM. Eclipse is set to -Xms256m -Xmx1024m, at the time when 
OutOfMemoryError occurs, up to 500MB physical memory is unused on the maschine. 

Kind Regards from Germany and Thanx for providing us with the best Developement 
Tool ever
Andreas
Comment 1 Olivier Thomann CLA 2004-08-02 13:18:44 EDT
Are you sure that you use -Xms256m -Xmx1024m with the -vmargs?

Could you please provide your .log file?
Comment 2 Andreas Heidrich CLA 2004-08-03 04:48:07 EDT
Yes, I am quite sure that these VMArgs are set. We need this since we debug 
Swing Applicatios sometimes and this is very memory consuming.
 
I have a LogFile that has > 7MB. I'll paste an excerpt into this comment, but I 
can also send you an copy upon request. 

>>
java.lang.OutOfMemoryError
!SESSION Jul 28, 2004 15:25:51.953 ---------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -Xms128m -Xmx718m

!ENTRY org.eclipse.jdt.core 4 4 Jul 28, 2004 15:25:51.953
!MESSAGE JavaBuilder handling CoreException while cleaning: Druckserver
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Problems encountered 
while deleting resources.
	at org.eclipse.core.internal.resources.Resource.delete
(Resource.java:683)
	at 
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders
(BatchImageBuilder.java:125)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean
(JavaBuilder.java:247)
	at org.eclipse.core.internal.events.BuildManager$2.run
(BuildManager.java:566)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:615)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:157)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run
(BuildManager.java:229)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:615)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:232)
	at org.eclipse.core.internal.events.BuildManager.build
(BuildManager.java:328)
	at org.eclipse.core.internal.resources.Project.build(Project.java:105)
	at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean
(CleanDialog.java:197)
	at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.execute
(CleanDialog.java:98)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:91)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1673)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:105)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
!SUBENTRY 1 org.eclipse.core.resources 4 4 Jul 28, 2004 15:25:51.953
!MESSAGE Problems encountered while deleting resources.
!SUBENTRY 2 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: /Druckserver/bin/de.
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Problems encountered 
while deleting resources.
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.delete
(FileSystemResourceManager.java:172)
	at org.eclipse.core.internal.resources.ResourceTree.standardDeleteFolder
(ResourceTree.java:621)
	at org.eclipse.core.internal.resources.Resource.unprotectedDelete
(Resource.java:1517)
	at org.eclipse.core.internal.resources.Resource.delete
(Resource.java:670)
	at 
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders
(BatchImageBuilder.java:125)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.clean
(JavaBuilder.java:247)
	at org.eclipse.core.internal.events.BuildManager$2.run
(BuildManager.java:566)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:615)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:157)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:249)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:202)
	at org.eclipse.core.internal.events.BuildManager$1.run
(BuildManager.java:229)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:615)
	at org.eclipse.core.runtime.Platform.run(Platform.java:747)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:232)
	at org.eclipse.core.internal.events.BuildManager.build
(BuildManager.java:328)
	at org.eclipse.core.internal.resources.Project.build(Project.java:105)
	at org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean
(CleanDialog.java:197)
	at org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.execute
(CleanDialog.java:98)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:91)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1673)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:105)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:101)
!SUBENTRY 3 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Problems encountered while deleting resources.
!SUBENTRY 4 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de\toyotafinance\a
ppframe\druckserver.
!SUBENTRY 4 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de\toyotafinance\a
ppframe.
!SUBENTRY 4 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de\toyotafinance.
!SUBENTRY 4 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de.
!SUBENTRY 3 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de\toyotafinance\a
ppframe\druckserver.
!SUBENTRY 3 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de\toyotafinance\a
ppframe.
!SUBENTRY 3 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de\toyotafinance.
!SUBENTRY 3 org.eclipse.core.resources 4 273 Jul 28, 2004 15:25:51.953
!MESSAGE Could not delete: 
C:\Programme\EclipseWorkspaces\Test\workspace\Druckserver\bin\de.

!ENTRY org.eclipse.ui 4 4 Jul 28, 2004 15:30:24.578
!MESSAGE Unable to find Action Set: org.eclipse.help.internal.ui.HelpActionSet
!SESSION Jul 28, 2004 16:54:57.812 ---------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -Xms128m -Xmx718m

!ENTRY org.eclipse.ui 4 4 Jul 28, 2004 16:54:57.812
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Jul 28, 2004 16:54:57.828
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError
!SESSION Jul 29, 2004 15:48:41.187 ---------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -Xms128m -Xmx718m

!ENTRY org.eclipse.ui 4 4 Jul 29, 2004 15:48:41.187
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Jul 29, 2004 15:48:41.296
!MESSAGE Failed to execute runnable (java.lang.OutOfMemoryError)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable 
(java.lang.OutOfMemoryError)
	at org.eclipse.swt.SWT.error(SWT.java:2691)
	at org.eclipse.swt.SWT.error(SWT.java:2616)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:109)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2749)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2434)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:254)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
	at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:96)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:335)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:273)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:129)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
	at org.eclipse.core.launcher.Main.run(Main.java:644)
	at org.eclipse.core.launcher.Main.main(Main.java:628)

!ENTRY org.eclipse.ui 4 4 Jul 29, 2004 15:48:41.312
!MESSAGE *** SWT nested exception

!ENTRY org.eclipse.ui 4 0 Jul 29, 2004 15:48:41.328
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError
!SESSION Aug 02, 2004 15:48:23.718 ---------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -Xms128m -Xmx718m

!ENTRY org.eclipse.ui 4 4 Aug 02, 2004 15:48:23.718
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.core.runtime 4 2 Aug 02, 2004 15:48:24.343
!MESSAGE An internal error occurred during: "Building workspace".
!STACK 0
java.lang.OutOfMemoryError

!ENTRY org.eclipse.ui 4 0 Aug 02, 2004 15:48:24.468
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError
<<
Comment 3 Kent Johnson CLA 2004-08-03 10:10:25 EDT
From your log trace, it appears your command line args are:

Command-line arguments: -Xms128m -Xmx718m
Comment 4 Olivier Thomann CLA 2004-08-03 10:46:55 EDT
Created attachment 13725 [details]
Complete .log file compressed
Comment 5 Kent Johnson CLA 2004-08-10 15:23:47 EDT
Please reopen when you can repeat the problem & have checked your specified VM 
args are accepted by the VM.
Comment 6 Kent Johnson CLA 2004-08-11 11:35:46 EDT
You can also verify that the VM is picking up your VM args by running with:

-verbose:gc

This should give you some GC info (too much, but its better than nothing).

Please paste the last part of the trace once you 'run out of memory'.
Comment 7 Andreas Heidrich CLA 2004-08-12 04:13:28 EDT
Created attachment 13905 [details]
Log File from a computer with verbose option set

See also the jpeg with the memory information.
Comment 8 Andreas Heidrich CLA 2004-08-12 04:15:19 EDT
Created attachment 13906 [details]
Hardcopy of the task managers memory usage tab
Comment 9 Andreas Heidrich CLA 2004-08-12 04:19:14 EDT
We followed the instruction on the message box and increased the memory up to 
1024m. Unfortunately the given trace was from a maschine where the developer 
lowered the settings because it had no affect on the OutOfMemoy error. 

I can send you a bunch of other log files that has the 1024m setting. And yes, 
I am sure that the vmargs are given in an correct manner. I also followed your 
advice with the verbose option. 

See a new trace below. I added the complete .log and an hardcopy of the task 
manager memory usage as an attachment too.

>> excerpt follows >>
!SESSION Aug 12, 2004 09:56:32.31 ----------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.2_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: eclipse -Xms256m -Xmx1024m -verbose:gc

!ENTRY org.eclipse.core.filebuffers 4 0 Aug 12, 2004 09:56:32.31
!MESSAGE The content type with id "com.objfac.xmlbuddy.xmlfile" specified in 
the extension point does not exist.

!ENTRY org.eclipse.core.resources 2 1 Aug 12, 2004 09:57:43.953
!MESSAGE Skipping builder 
com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder for project 
TestMaintenanceEnvironment. Either the builder is missing from the install, or 
it belongs to a project nature that is missing or disabled.

!ENTRY org.eclipse.core.resources 2 1 Aug 12, 2004 10:00:07.546
!MESSAGE Skipping builder 
com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder for project IReport. 
Either the builder is missing from the install, or it belongs to a project 
nature that is missing or disabled.

!ENTRY org.eclipse.core.resources 2 1 Aug 12, 2004 10:01:40.109
!MESSAGE Skipping builder org.epic.perleditor.perlbuilder for project 
xxPerlTest. Either the builder is missing from the install, or it belongs to a 
project nature that is missing or disabled.

!ENTRY org.eclipse.ui 4 4 Aug 12, 2004 10:02:33.609
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Aug 12, 2004 10:02:33.625
!MESSAGE java.lang.OutOfMemoryError
!STACK 0
java.lang.OutOfMemoryError

!ENTRY org.eclipse.core.runtime 4 2 Aug 12, 2004 10:02:33.671
!MESSAGE An internal error occurred during: "Building workspace".
!STACK 0
java.lang.OutOfMemoryError

!ENTRY org.eclipse.ui 4 4 Aug 12, 2004 10:02:49.375
!MESSAGE Unhandled event loop exception
Comment 10 Kent Johnson CLA 2004-08-12 12:25:42 EDT
Sorry I should have been clearer, you need to run eclipse with a command line 
like:

eclipse -data d:/workspace -vm d:/jdk1.4.2/bin/java.exe -vmargs -Xmx512m -
verbose:gc

Then copy the GC trace from the command prompt. The GC info is not written to 
the eclipse .log.
Comment 11 Philipe Mulet CLA 2005-04-07 08:08:32 EDT
Still an issue?
Comment 12 Andreas Heidrich CLA 2005-04-07 09:18:25 EDT
No, sorry for not responding to the last Post. We found that we had
misconfigured command line arguments. Meanwhile we have corrected the command
lines on all maschines and we run fine with Xms256 and Xmx768 with GUI debugs
and everything else. 

We apologize for the confusuion. 

Andreas
Comment 13 Andreas Heidrich CLA 2005-04-07 09:21:51 EDT
Resolved for us.