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