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

Paolo Castagna commented on JENA-125:
-------------------------------------

Hi Mikhail, I put your code into a main() method to execute it from a command 
line and to be able to inspect it with a profiler (i.e. jvisualvm or YourKit 
would do). That allows you to inspect the memory and see how many instances for 
each class are allocated during the execution.

Have you tried that?

I tried with -Xmx128m and even -Xmx64m (although it's something I would not 
recommend!), using an Oracle JVM 1.6.x. 
It run to completion for me.

What JVM were you using? 
How were you running your test?

NodeTableCache has a couple of LRU caches of 100,000 items each to map Node 
objects into NodeId and vice versa. There is also a small (i.e. 100) LRU "cache 
set". These should not consume a large amount of RAM. A lot of Strings are 
created and used and that accounts for the char[] arrays.
                
> 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