Bug 419838 - Bug_217673.test runs very long and throws OOME often on Mac
Summary: Bug_217673.test runs very long and throws OOME often on Mac
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M4   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
: 419841 420259 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-18 08:20 EDT by Dani Megert CLA
Modified: 2013-11-15 04:11 EST (History)
3 users (show)

See Also:


Attachments
Fix (1.77 KB, patch)
2013-11-14 08:51 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2013-10-18 08:20:52 EDT
Bug_217673.test runs into OOM often:

http://download.eclipse.org/eclipse/downloads/drops4/N20131016-2000/testresults/html/org.eclipse.team.tests.core_macosx.cocoa.x86_5.0.html

Java heap space

java.lang.OutOfMemoryError: Java heap space
at org.eclipse.core.internal.events.NodeIDMap.expand(NodeIDMap.java:55)
at org.eclipse.core.internal.events.NodeIDMap.put(NodeIDMap.java:170)
at org.eclipse.core.internal.events.NodeIDMap.putNewPath(NodeIDMap.java:215)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:104)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeNodeIDMap(ResourceDeltaFactory.java:120)
at org.eclipse.core.internal.events.ResourceDeltaFactory.computeDelta(ResourceDeltaFactory.java:64)
at org.eclipse.core.internal.events.NotificationManager.getDelta(NotificationManager.java:231)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:140)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:396)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1531)
at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1718)
at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:711)
at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:647)
at org.eclipse.team.tests.core.regression.Bug_217673.test(Bug_217673.java:39)
Comment 1 Dani Megert CLA 2013-10-18 08:21:54 EDT
David, did you get additional info regarding the OOME?
Comment 2 Dani Megert CLA 2013-10-18 08:24:16 EDT
I've increased the memory to see whether this helps.

http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=f8523030fcb891524f5cf6d7cf8d6573a0cea03a
Comment 3 Dani Megert CLA 2013-10-18 08:55:42 EDT
*** Bug 419841 has been marked as a duplicate of this bug. ***
Comment 4 David Williams CLA 2013-10-18 09:00:15 EDT
I could not find any obvious memory issues on that machine by "looking at" processes running, and did find out it has 8 G total (though several "executors") thought don't think it is often that more than one are running at the same time. 


I've asked for more "up to date" VMs be installed ... bug 419842 ... since suspect that's where most of our committers test and end-users use (u25 or u45). 

Thanks,
Comment 5 Dani Megert CLA 2013-10-22 06:31:09 EDT
(In reply to Dani Megert from comment #2)
> I've increased the memory to see whether this helps.
> 
> http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/
> ?id=f8523030fcb891524f5cf6d7cf8d6573a0cea03a

This did not help.
Comment 6 David Williams CLA 2013-10-22 23:31:30 EDT
(In reply to Dani Megert from comment #5)
> (In reply to Dani Megert from comment #2)
> > I've increased the memory to see whether this helps.
> > 
> > http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/
> > ?id=f8523030fcb891524f5cf6d7cf8d6573a0cea03a
> 
> This did not help.

I've update the VM used to u25 (was at u10) in the slight chance it is "VM related".
Comment 7 Dani Megert CLA 2013-10-23 05:06:11 EDT
(In reply to David Williams from comment #6)
> (In reply to Dani Megert from comment #5)
> > (In reply to Dani Megert from comment #2)
> > > I've increased the memory to see whether this helps.
> > > 
> > > http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/
> > > ?id=f8523030fcb891524f5cf6d7cf8d6573a0cea03a
> > 
> > This did not help.
> 
> I've update the VM used to u25 (was at u10) in the slight chance it is "VM
> related".

Did that update work? No tests ran on the Mac (N20131022-2000).
Comment 8 Dani Megert CLA 2013-10-23 06:44:33 EDT
(In reply to Dani Megert from comment #7)
> Did that update work? No tests ran on the Mac (N20131022-2000).

Ah, they ran now - just took long. An I noticed that you updated the JRE after that build was done.
Comment 9 Dani Megert CLA 2013-10-24 08:07:47 EDT
*** Bug 420259 has been marked as a duplicate of this bug. ***
Comment 11 Markus Keller CLA 2013-10-24 13:03:36 EDT
Problem doesn't seem to be Mac-specific. The test took 1047.799s in I20131022-1300 on Windows.
Comment 12 Dani Megert CLA 2013-10-25 04:14:31 EDT
(In reply to Markus Keller from comment #11)
> Problem doesn't seem to be Mac-specific. The test took 1047.799s in
> I20131022-1300 on Windows.

Indeed! But it doesn't run into OOME and locally (Mac and Windows) it was always fast and green.
Comment 13 Markus Keller CLA 2013-11-14 08:51:36 EST
Created attachment 237467 [details]
Fix

The bug is just a bad choice of directory to link to:

	project.getFolder("test").createLink(getTempDir(), IResource.NONE,
			null);

This has to blow up at some point once the machine has accumulated enough garbage in the shared temp directory.
Comment 15 David Williams CLA 2013-11-14 09:59:31 EST
(In reply to Markus Keller from comment #13)
> Created attachment 237467 [details]
> Fix
> 
> The bug is just a bad choice of directory to link to:
> 
> 	project.getFolder("test").createLink(getTempDir(), IResource.NONE,
> 			null);
> 
> This has to blow up at some point once the machine has accumulated enough
> garbage in the shared temp directory.

I'm not sure what you mean by "shared temp directory", (and too lazy to look at actual code right at the moment) ... but we do purposely define 
-Djava.io.tmpdir=${WORKSPACE}/tmp 
in our scripts so we don't use the machine's /tmp directory, but use one we create under Hudson's WORKSPACE (which, we clean before each run). This allows us to use java.io.File.createTempFile (...) without worrying about size or condition of system's /tmp directory. 

I just mention this in case it helps.
Comment 16 Markus Keller CLA 2013-11-14 10:44:11 EST
(In reply to David Williams from comment #15)
> I'm not sure what you mean by "shared temp directory", (and too lazy to look
> at actual code right at the moment) ... but we do purposely define 
> -Djava.io.tmpdir=${WORKSPACE}/tmp 

> I just mention this in case it helps.

Yes, that's very helpful! But when I open the first 'Properties >>' link in http://download.eclipse.org/eclipse/downloads/drops4/N20131113-2000/testresults/html/org.eclipse.team.tests.core_win32.win32.x86_7.0.html , I see:

Windows: java.io.tmpdir	C:\Users\HUDSON~1\AppData\Local\Temp\
Mac: java.io.tmpdir	/var/folders/_h/k2j3zybx5yq8xyssgt4vfns00000gp/T/
Linux: java.io.tmpdir	/opt/users/hudsonbuild/workspace/ep4-unit-lin64/tmp

=> Looks like the tempdir is only set on Linux (where the test was indeed always quick).

The released fix for this bug still makes sense for everybody running with the default tmpdir.
Comment 17 David Williams CLA 2013-11-14 12:20:54 EST
(In reply to Markus Keller from comment #16)
> (In reply to David Williams from comment #15)
> 
> Windows: java.io.tmpdir	C:\Users\HUDSON~1\AppData\Local\Temp\
> Mac: java.io.tmpdir	/var/folders/_h/k2j3zybx5yq8xyssgt4vfns00000gp/T/
> Linux: java.io.tmpdir	/opt/users/hudsonbuild/workspace/ep4-unit-lin64/tmp
> 
> => Looks like the tempdir is only set on Linux (where the test was indeed
> always quick).
> 

Thanks for this data. I've opened bug 421761 to follow-up. I know at least p2 uses it "under the covers" for some things so it'd be best to get it defined and used correctly.
Comment 18 Dani Megert CLA 2013-11-15 04:11:22 EST
Verified in N20131114-2000.