Re: [jopendocument] Perm Gen out of memory problem with JOpenDocument 3

2013-09-05 Thread Sylvain Cuaz

Le 09/08/2013 10:17, FL a écrit :

Hello,

In my application Java, I have a tool of migration which allows me to push
towards CouchDB (No-SQL DB) in JSON (Jackon), XML(JAXB), and PDF format
corresponding to these folders (POJOs/Object Java).

In the 500th iteration (approximately) the memory PermGen is saturated, and
the JVM is blocked(surrounded). It is necessarily necessary to restart the
JBoss server ...
We analyzed the evolution of the memory with JConsole (of the jdk) and also
JProfiler 8 => leak og PermGen memory ...
It would seem that JOpenDocument is not adapted in batch processing.


	Well, jOpenDocument has been used in production for many years, with long running processes and we 
never saw an OutOfMemoryError.



Here is a result of our UnitTest :

*The unit test :*

@Test
 public void testDeCharge() throws DouaneException, JDOMException,
TemplateException, IOException {

.

 }


This doesn't give more information about your problem. And since it's incomplete no one can try to 
replicate your problem. I've attached a test, when I run it in jProfiler no objects of jOpenDocument 
remains in memory at the end (except some static constants) and the total JVM memory is 1.1 MB.




*The console output : *

java.lang.OutOfMemoryError: PermGen space
 at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
 at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
 at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865)
 at org.jopendocument.dom.ODPackage$1.processEntry(Unknown Source)
 at org.jopendocument.util.ZippedFilesProcessor.process(Unknown Source)
 at org.jopendocument.dom.ODPackage.(Unknown Source)
 at org.jopendocument.dom.template.Template.(Unknown Source)
 at org.jopendocument.dom.template.RhinoStreamTemplate.(Unknown 
Source)
 at 
fr.gouv.finances.douane.banaco.edition.dossier.DossierExAnteEdition.getSelectedTemplate(DossierExAnteEdition.java:45)
 at 
fr.gouv.finances.douane.banaco.edition.dossier.DossierEdition.editer(DossierEdition.java:214)
 at 
fr.gouv.finances.douane.banaco.edition.dossier.DossierTest.testDeCharge(DossierTest.java:124)


There's RhinoStreamTemplate in your stack trace, meaning you don't use jOpenDocument 1.3 but an 
older one. Also the part where the JRE runs out of memory and the part that's causing the leak may 
not be the same.



Heve you an idea ?


You could either provide a minimal runnable sample of your code exhibiting the leak. Or since the 
code is apparently for the french customs and might need the commercial licence, buy one.



Cheers,
Sylvain

--

--- 
You received this message because you are subscribed to the Google Groups "jOpenDocument" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 * 
 * Copyright 2008 jOpenDocument, by ILM Informatique. All rights reserved.
 * 
 * The contents of this file are subject to the terms of the GNU General Public 
License Version 3
 * only ("GPL"). You may not use this file except in compliance with the 
License. You can obtain a
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the 
License for the specific
 * language governing permissions and limitations under the License.
 * 
 * When distributing the software, include this License Header Notice in each 
file.
 */

package org.jopendocument.sample;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jopendocument.dom.OOUtils;
import org.jopendocument.dom.template.EngineTemplate;
import org.jopendocument.dom.template.RhinoTemplate;

public class TestTemplate {

public static void main(String[] args) {
try {
File templateFile = new File("template/test.odt");
File outFile = new File("out.odt");

final List> months = new ArrayList>();
months.add(createMap("January", "-12", "3"));
months.add(createMap("February", "-8", "5"));
months.add(createMap("March", "-5", "12"));
months.add(createMap("April", "-1", "15"));
months.add(createMap("May", "3", "21"));

for (int i = 0; i < 200; i++) {
// Load the template.
EngineTemplate template = new RhinoTemplate(templateFile);

// Fill with sample values.
template.setField("toto", "value set using setField()");
template.setField("months", months);

template.hideParagraph("p1");
template.hideSection("section1");

// Save to file.
template.saveAs(outFil

Re: [jopendocument] Perm Gen out of memory problem with JOpenDocument 3

2013-08-09 Thread FL
Hello,

In my application Java, I have a tool of migration which allows me to push 
towards CouchDB (No-SQL DB) in JSON (Jackon), XML(JAXB), and PDF format 
corresponding to these folders (POJOs/Object Java).

In the 500th iteration (approximately) the memory PermGen is saturated, and 
the JVM is blocked(surrounded). It is necessarily necessary to restart the 
JBoss server ...
We analyzed the evolution of the memory with JConsole (of the jdk) and also 
JProfiler 8 => leak og PermGen memory ...
It would seem that JOpenDocument is not adapted in batch processing.

Here is a result of our UnitTest :

*The unit test :*

@Test
public void testDeCharge() throws DouaneException, JDOMException, 
TemplateException, IOException {
DossierTestBuilder builder = new DossierTestBuilder();

List dossiers = new ArrayList();

dossiers.add(builder.getDossierComplet(TypeDossier.EXANTE));
dossiers.add(builder.getDossierComplet(TypeDossier.EXPOST1));
dossiers.add(builder.getDossierComplet(TypeDossier.EXPOST2_AUTRE));

dossiers.add(builder.getDossierComplet(TypeDossier.EXPOST2_FINANCE));
dossiers.add(builder.getDossierComplet(TypeDossier.TSVR));

int j = 0;
for(int i = 0; i < 1000; i++) {
for(Dossier dossier : dossiers) {
DossierEdition.getDossierEdition(dossier).editer(dossier);
j++;
log.info("Dossier " + j + " OK...");
}
}
}

*The console output : *

java.lang.OutOfMemoryError: PermGen space 
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
 

at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 

at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518) 
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865) 
at org.jopendocument.dom.ODPackage$1.processEntry(Unknown Source) 
at org.jopendocument.util.ZippedFilesProcessor.process(Unknown Source) 
at org.jopendocument.dom.ODPackage.(Unknown Source) 
at org.jopendocument.dom.template.Template.(Unknown Source) 
at org.jopendocument.dom.template.RhinoStreamTemplate.(Unknown 
Source) 
at 
fr.gouv.finances.douane.banaco.edition.dossier.DossierExAnteEdition.getSelectedTemplate(DossierExAnteEdition.java:45)
 

at 
fr.gouv.finances.douane.banaco.edition.dossier.DossierEdition.editer(DossierEdition.java:214)
 

at 
fr.gouv.finances.douane.banaco.edition.dossier.DossierTest.testDeCharge(DossierTest.java:124)
 

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 


at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 

at java.lang.reflect.Method.invoke(Method.java:597) 
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
 

at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
 

at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
 

at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
 

at 
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
 

at 
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
 

at 
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
 

at 
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
 

at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
 

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) 
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) 
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) 
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) 
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) 
at 
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
 

at 
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
 

java.lang.OutOfMemoryError: PermGen space 
at java.lang.ClassLoader.defineClass1(Native Method) 
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) 
at java.lang.ClassLoader.defineClass(ClassLoader.java:615) 
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) 
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) 
at java.net.URLClassLoader.access$000(URLClassLoader.java:58) 
at java.net.URLClassLoader$1.run(U

Re: [jopendocument] Perm Gen out of memory problem with JOpenDocument 3

2013-08-09 Thread FL
Hello,

In my Java application, I have a tool of migration which allows me to push 
towards CouchDB (folder objects) in JSON (Jackson), XML (by JAXB), and 
document PDF (JOpenDocument + JODConverter)  corresponding to these 
files(cases).
In the 500th iteration (approximately) the memory PermGen is saturated, and 
the JVM is blocked(surrounded). It is necessarily necessary to restart the 
waiter(server)!
We analyzed the evolution of the memory with JConsole.exe (jdk), and also 
JProfiler 8. 
It would seem that JOpenDocument is not adapted in batch processing.

Thanks,

Florent


Le jeudi 8 août 2013 19:39:42 UTC+2, guillaume...@gmail.com a écrit :
>
> Hi,
>
> what do you mean by "each loop"?
>
> Regards,
> Guillaume
>
>
>
> 2013/8/8 FL >
>
>> Hi,
>>
>> I have a problem with the JVM Perm Gen memory. 
>> Server JBoss started with XX:MaxPermSize=256m but it's never enough ...
>> Each loop adds(consumes) approximatively 1 Mo in the PermGen (from my 
>> batch tool). 
>> When PermGen is full, the JVM fail.
>>
>> The cause is these instructions : 
>>
>> *rhinoTemplate.saveAs(odtFile);*
>> 
>>  or
>> *
>> ODSingleXMLDocument odSingleXMLDocument = 
>> selectedTemplate.createDocument();
>> odSingleXMLDocument.saveToPackageAs(odtFile);*
>>
>> Sorry for my bad english.
>> Have you any idea for this big problem ?
>>  
>> -- 
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "jOpenDocument" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jopendocumen...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [jopendocument] Perm Gen out of memory problem with JOpenDocument 3

2013-08-08 Thread Guillaume Maillard
Hi,

what do you mean by "each loop"?

Regards,
Guillaume



2013/8/8 FL 

> Hi,
>
> I have a problem with the JVM Perm Gen memory.
> Server JBoss started with XX:MaxPermSize=256m but it's never enough ...
> Each loop adds(consumes) approximatively 1 Mo in the PermGen (from my
> batch tool).
> When PermGen is full, the JVM fail.
>
> The cause is these instructions :
>
> *rhinoTemplate.saveAs(odtFile);*
>
>  or
> *
> ODSingleXMLDocument odSingleXMLDocument =
> selectedTemplate.createDocument();
> odSingleXMLDocument.saveToPackageAs(odtFile);*
>
> Sorry for my bad english.
> Have you any idea for this big problem ?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "jOpenDocument" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jopendocument+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[jopendocument] Perm Gen out of memory problem with JOpenDocument 3

2013-08-08 Thread FL
Hi,

I have a problem with the JVM Perm Gen memory. 
Server JBoss started with XX:MaxPermSize=256m but it's never enough ...
Each loop adds(consumes) approximatively 1 Mo in the PermGen (from my batch 
tool). 
When PermGen is full, the JVM fail.

The cause is these instructions : 

*rhinoTemplate.saveAs(odtFile);*

 or
*
ODSingleXMLDocument odSingleXMLDocument = selectedTemplate.createDocument();
odSingleXMLDocument.saveToPackageAs(odtFile);*

Sorry for my bad english.
Have you any idea for this big problem ?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.