You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2018/08/01 14:13:00 UTC

[jira] [Commented] (JENA-1582) Model#write OutOfMemory GC limit exceeded

    [ https://issues.apache.org/jira/browse/JENA-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16565385#comment-16565385 ] 

Andy Seaborne commented on JENA-1582:
-------------------------------------

The code is (in Jena 3) trying to write in "pretty RDF/XML" whereas in 2.13.0 the default was plain RDF/XML.

Pretty RDF/XML can be expensive (in time and space)

Try:
{code:java}
try (OutputStream out = new FileOutputStream(f.toFile())) {
    RDFDataMgr.write(out, model, RDFFormat.RDFXML_PLAIN);
 }
{code}
Other points:

Buffering the output might help a little.


 It is better to use Java `InputStream` and `OutputStream` than Java `Reader` or `Writer` to write RDF, especially RDF/XML.

 

> Model#write OutOfMemory GC limit exceeded
> -----------------------------------------
>
>                 Key: JENA-1582
>                 URL: https://issues.apache.org/jira/browse/JENA-1582
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: Jena 3.8.0
>            Reporter: Arnaud Jardine
>            Priority: Major
>         Attachments: sources.zip
>
>
> Hello,
> Actually we try to migrate a project from an old version of Jena (2.13.0) to a more recent but we experienced some issue when we try to write the model with Model#write.
> With Jena 2.13.0 the model is written quite fast on the disk but with Jena 3.8.0, the process seems stuck into a loop and we reach an OOM Exception : GC limit exceeded.
> I've attach a small project to reproduce the problem. It contains the model (http___publications_europa_eu_resource_authority_language.rdf) and the code which simulate our behavior.
> Thanks for your help,
> Arnaud.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)