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

Mikhail Sogrin commented on JENA-125:
-------------------------------------

It's a bug, because it fails with OutOfMemory error crashing the whole 
application as soon as cache fills all available memory. -Xmx128m was an 
example value where the limit is hit quite quickly. Dropping cache does not 
seem to start working at all. In my understanding, it should delete data from 
cache when there's not enough memory.

With -Xmx1024m, it seems to do proper caching and does not crash.

If you propose to close this as not a bug, then at least update TDB 
documentation at http://openjena.org/wiki/TDB/Requirements from the mild 
recommendation that "In practice, the JVM heap size should be set to at least 
1Gbyte" to something indicating that TDB may crash if there's not enough 
memory, or suggest a way to configure TDB to consume less RAM.
                
> OutOfMemoryError when adding data to the TDB model
> --------------------------------------------------
>
>                 Key: JENA-125
>                 URL: https://issues.apache.org/jira/browse/JENA-125
>             Project: Jena
>          Issue Type: Bug
>          Components: TDB
>         Environment: Fedora 64-bit.
> Using 32-bit JVM or manually setting FileMode.direct with 64-bit JVM.
> Jena 2.6.4, TDB 0.8.10.
>            Reporter: Mikhail Sogrin
>
> There's an OutOfMemory exception when adding data to the TDB model with the 
> following code:
> public class JenaAddPerfTest {
>     private Model model;
>     private Resource cls;
>     
>     @Before
>     public void init() {
>         File file = new 
> File(System.getProperty("java.io.tmpdir")+"/test-"+UUID.randomUUID().toString());
>         file.mkdirs();
>         
>         model = TDBFactory.createModel(file.getAbsolutePath());
>         cls = model.createResource("http://example.com/class";);
>         cls.addProperty(RDF.type, OWL.Class);
>         cls.addProperty(RDFS.subClassOf, OWL.Thing);
>     }
>     
>     @After
>     public void close() {
>         model.close();
>     }
>     
>     @Test
>     public void test() {
>         for (int i=0; i<10000000; i++) {
>             model.createResource("http://example.com/res"+i, cls);
>             if (i%10000 == 0) {
>                 System.out.println(i);
>             }
>         }
>     }
> }
> The exception happens after ~670000 iterations with -Xmx128m.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to