[jira] [Updated] (FOP-3269) Free memory after building struct elem tree

"Simon Steiner (Jira)" <[email protected]>
Newsgroups gmane.text.xml.fop.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/FOP-3269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Steiner updated FOP-3269:
-------------------------------
    Summary: Free memory after building struct elem tree  (was: Allow GC to remove structelem tree)

> Free memory after building struct elem tree
> -------------------------------------------
>
>                 Key: FOP-3269
>                 URL: https://issues.apache.org/jira/browse/FOP-3269
>             Project: FOP
>          Issue Type: Bug
>            Reporter: Simon Steiner
>            Assignee: Simon Steiner
>            Priority: Major
>             Fix For: main
>
>
> Generate pdf twice with a table with 10k fo:table-body's with using -Xmx500m should not give OOM
> {code:java}
> public void xxx() throws Exception {
>     FopConfParser fopConfParser = new FopConfParser(new File("fop.xconf"),
>             new File("xxx").toURI());
>     FopFactoryBuilder fopFactoryBuilder = fopConfParser.getFopFactoryBuilder();
>     fopFactoryBuilder.setStrictFOValidation(false);
>     FopFactory fopFactory = fopFactoryBuilder.build();
>     x(fopFactory);
>     fopFactory = fopFactoryBuilder.build();
>     x(fopFactory);
> }
> private void x(FopFactory fopFactory) throws Exception {
>     FOUserAgent userAgent = fopFactory.newFOUserAgent();
>     Transformer transformer = TransformerFactory.newInstance().newTransformer();
>     Source src = new StreamSource(new FileInputStream("out.if"));
>     IFDocumentHandler documentHandler
>             = userAgent.getRendererFactory().createDocumentHandler(userAgent, MimeConstants.MIME_PDF);
>     documentHandler.setResult(new StreamResult(new NullOutputStream()));
>     IFUtil.setupFonts(documentHandler);
>     IFParser parser = new IFParser();
>     Result res = new SAXResult(parser.getContentHandler(documentHandler, userAgent));
>     transformer.transform(src, res);
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.