|
Re: OutOfMemory on Resource.save() [message #740535 is a reply to message #740519] |
Tue, 18 October 2011 16:06 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Esteban,<br>
<br>
You'll want to try using<br>
<blockquote> /**<br>
* Write the intermediate results of serialization to the file
system rather to an in-memory buffer.<br>
* This helps to reduce memory requirements for serializing a
large file, but it's slower.<br>
* The default is <code>Boolean.FALSE</code> unless
set to <code>Boolean.TRUE</code> explicitly.<br>
*/<br>
String OPTION_USE_FILE_BUFFER = "USE_FILE_BUFFER";<br>
</blockquote>
<br>
<br>
On 18/10/2011 5:45 PM, Esteban Dugueperoux wrote:
<blockquote cite="mid:j7k68d$qba$1@news.eclipse.org" type="cite">Hi,
<br>
<br>
I have a big XMI Resource (a file of 30MB in average) on which I
do many changes (migration processing), at the end I do a
Resource.save() but I get a OutOfMemory error. Taking a memory
snapshot with Memory Analyzer, I see that the biggest object is
taken by a array
org.eclipse.emf.ecore.xmi.impl.StringSegment$Element[] taking
250MB in average and the OutOfMemoryError occurs at
StringElement.write() more precisely at :
<br>
<br>
at java.util.Arrays.copyOf(2786)
<br>
at java.io.ByteArrayOutputStream.write(94)
<br>
at sun.nio.cs.StreamEncoder.writeBytes(202)
<br>
at sun.nio.cs.StreamEncoder.implWrite(263)
<br>
at sun.nio.cs.StreamEncoder.write(106)
<br>
at java.io.OutputStreamWriter.write(190)
<br>
at org.eclipse.emf.ecore.xmi.impl.StringSegment.write(407)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.write(1009)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(266)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(206)
<br>
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(1406)
<br>
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(993)
<br>
<br>
With a sun jvm 1.6.0_26 on Linux Ubuntu.
<br>
<br>
Someone has already had similar issues or have a idea of this big
memory usage?
<br>
<br>
Best Regards.
<br>
</blockquote>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02474 seconds