It's all about the answers!

Ask a question

OutOfMemoryError while starting Eclipse relates to RTCs FeedManager


Kurtis Martin (1.4k11) | asked May 20 '14, 10:49 a.m.
JAZZ DEVELOPER
Been running fine for Months, but this morning started getting OutOfMemoryError when starting eclipse.  The error looks to be related to RTC and some FeedManager class loading of it's EMF model. 

The problem also seems to related to the Oracle JRE.  When running with IBM JRE it doesn't happen.

Environment details:
   Eclipse version: Juno 4.2.2
   RTC version: 4.0.2 Build id: RTC-I20130222-1633
   Oracle JRE - not working: 1.7.0_51 build 1.7.0_51-b13
   IBM JRE - works:1.7.0 build pwa6470_27-20131115_04

The Oracle JRE has been working fine for months.  Not sure why this issue started happening today.  I didn't update JREs or anything else within Eclipse.

Here's the stack trace:

java.lang.OutOfMemoryError: Java heap space
    at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:208)
    at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:226)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:978)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1546)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1318)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2770)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
    at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
    at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
    at com.ibm.team.foundation.rcp.core.internal.EMFStorageHelper.loadModel(EMFStorageHelper.java:39)
    at com.ibm.team.feed.core.FeedManager.getModel(FeedManager.java:196)
    at com.ibm.team.feed.core.FeedManager.access$3(FeedManager.java:192)
    at com.ibm.team.feed.core.FeedManager$Holder.<clinit>(FeedManager.java:169)
    at com.ibm.team.feed.core.FeedManager.getDefault(FeedManager.java:173)
    at com.ibm.team.feed.ui.internal.FeedStartup.earlyStartup(FeedStartup.java:26)
    at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.Workbench$54.run(Workbench.java:2412)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

4 answers



permanent link
Donald Nong (14.5k614) | answered May 20 '14, 10:22 p.m.
Hi Kurtis,
It's possible that your Eclipse workbench needs to load more stuff than before and the heap size is not big enough. The error clearly says it's the heap space.
java.lang.OutOfMemoryError: Java heap space
Normally, you need to adjust the heap size to overcome this problem. Modify the eclipse.ini file and change the -Xmx parameter accordingly. To get an idea how big the heap size you can adjust, have a read on this document.
http://publib.boulder.ibm.com/infocenter/javasdk/tools/topic/com.ibm.java.doc.igaa/_1vg000139b8b453-11951f1e7ff-8000_1001.html

permanent link
Kurtis Martin (1.4k11) | answered May 21 '14, 8:41 a.m.
JAZZ DEVELOPER
Thx for the input Donald.  I forgot to mention that when I hit this issue I changed my -Xmx from 2048M to 5048M, just to see what would happen.  And for whatever reason 5GB is still not enough for Eclipse when I'm running with Oracle 64-bit JVM.  Keep in mind that I've been running with Oracle JVM using 2GB max heap for months.

Then without making any other change, simply switch Eclipse to the IBM 64-bit JVM, it only needs about 1.2 GB of memory.  Close Eclipse and restart with Oracle JVM the memory goes above 5GB and the stack trace is the same as above.

The above stack trace goes through com.sun.org.apache.xerces.internal.* classes.  I assume the IBM JVM doesn't use those classes.  Perhaps something within the EMF Model file needed by RTCs FeedManager is triggering a memory leak in these JVM specific xerces classes.

Comments
Donald Nong commented May 21 '14, 11:54 p.m.

Hi Kurtis,
That's very interesting. I believe Xerces xml-commons component was at work when the problem occurred. Most of the data transactions within RTC utilize XML anyway. The curious thing is that it appears Sun has its own implementation of Xerces. IBM Java uses Apache Xerces if I'm not mistaken.
I suspect that's an infinite-loop issue rather than memory leak. If you have to use Oracle Sun Java, you probably need to open a defect against it.


permanent link
Kurtis Martin (1.4k11) | answered Jun 23 '14, 4:58 p.m.
JAZZ DEVELOPER
I was able to create a new workspace and run Eclipse without seeing this issue.  Then I copied this file from my new workspace and replaced it in my original workspace:

<workspace_dir>\.metadata\.plugins\com.ibm.team.feed.core\data.xml

After that the issue was resolved for my original workspace ;)

My data.xml had grown to over 12MB and seemed to contain a bunch of entries from several months ago.  It also had some unicode characters in it.  Not certain of the root cause, but all seems well now.

permanent link
Rohit Balduwa (945511) | answered Jun 24 '14, 12:09 a.m.
Hi Kurtis

The below blog gives an overview of how much heap space is currently occupied( or free) which can be monitored using the IBM RTC eclipse client.
This might help you make a judgement on changing the Xmx(maximum heap space) accordingly.
https://www.ibm.com/developerworks/community/blogs/nfrsblog/entry/ibm_rtc_eclipse_client_and_monitoring_the_heap_space

Regards,
Rohit

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.