I'm trying to output data using Pellet, but my application always crashes during reasoning due to "OutOfMemoryError: Java heap space".
As suggested elsewhere, I have already tried to increase the heap size and I am currently using these VM arguments: "-XX: MaxPermSize = 256m -Xmx6144m". In addition, I have to set 'PelletOptions.USE_CONTINUOUS = true ", but so far I could only delay the crash for several minutes. (The longest run so far: 30 min.).
I store data in the Jena TDB triple. Its total size is 170 MB and consists of 962117 applications. The ontology was modeled in Protege, and there are no contradictions, if you argue using the Hermit or Fact ++ (of course, there is no data at the moment). Statements, which I would like for output, were modeled using equivalent classes (for example, A and (hasX some X)), inverse properties (hasX β isXOf) and some transitive properties. There are 55 classes: 14 root classes, 11 equivalent classes (all subtypes of the same root class). At the moment, instances of 14 classes have been added in the triest.
I also used pellint to analyze my ontology, but I'm not sure which conclusions to draw from this result:
[Untyped classes] - http://www.w3.org/2002/07/owl#AllDisjointClasses [Untyped object roles] - http://www.w3.org/2002/07/owl#topObjectPriority - http://www.w3.org/2002/07/owl#members [Untyped datatype roles] - http://www.w3.org/2002/07/owl
This is my code for creating InfModel:
Dataset dataset = TDBFactory.createDataset(..); Model model = dataset.getDefaultModel(); OntModel ont = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,model); ont.read("file:.." , "RDF/XML"); PelletOptions.USE_CONTINUOUS_RULES = true; Reasoner reasoner = PelletReasonerFactory.theInstance().create(); reasoner = reasoner.bindSchema(ont); InfModel infModel = infModel = ModelFactory.createInfModel(reasoner, model);
and this is essentially how I request data:
QueryExecution qe = QueryExecutionFactory.create("SELECT ...", infModel); Resultset rs = qe.execSelect(); while(rs.hasNext()) { QuerySolution sol = rs.nextSolution(); ... } qe.close();
As you can see, I got various exceptions when either requesting data, preparing or checking InfModel. Do you have an idea that otherwise I could try to resolve this error?
java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source) at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at java.net.URLStreamHandler.parseURL(Unknown Source) at sun.net.www.protocol.file.Handler.parseURL(Unknown Source) at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at sun.misc.URLClassPath$FileLoader.getResource(Unknown Source) at sun.misc.URLClassPath.getResource(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCheck.warn(QueryIteratorCheck.java:114) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCheck.dump(QueryIteratorCheck.java:95) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCheck.checkForOpenIterators(QueryIteratorCheck.java:68) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCheck.close(QueryIteratorCheck.java:50) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.closeIterator(QueryIteratorWrapper.java:50) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.close(QueryIteratorBase.java:184) at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCloseable.close(QueryIteratorCloseable.java:39) at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.close(QueryExecutionBase.java:180) java.lang.OutOfMemoryError: Java heap space at shared.SharedObjectFactory.build(SharedObjectFactory.java:303) at aterm.pure.PureFactory.makeAppl(PureFactory.java:191) at aterm.pure.PureFactory.makeAppl(PureFactory.java:185) at aterm.pure.PureFactory.makeAppl(PureFactory.java:228) at org.mindswap.pellet.utils.ATermUtils.makeLiteral(ATermUtils.java:245) at org.mindswap.pellet.ABox.addLiteral(ABox.java:1696) at org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.applySomeValuesRule(SomeValuesRule.java:174) at org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.apply(SomeValuesRule.java:64) at org.mindswap.pellet.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:64) at org.mindswap.pellet.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:157) at org.mindswap.pellet.ABox.isConsistent(ABox.java:1423) at org.mindswap.pellet.ABox.isConsistent(ABox.java:1260) at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1987) at org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2061) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:247) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:230) at com.hp.hpl.jena.rdf.model.impl.InfModelImpl.prepare(InfModelImpl.java:89) java.lang.OutOfMemoryError: Java heap space at org.mindswap.pellet.tableau.branch.DisjunctionBranch.tryBranch(DisjunctionBranch.java:197) at org.mindswap.pellet.tableau.branch.Branch.tryNext(Branch.java:117) at org.mindswap.pellet.tableau.completion.rule.ChooseRule.apply(ChooseRule.java:82) at org.mindswap.pellet.tableau.completion.rule.ChooseRule.apply(ChooseRule.java:56) at org.mindswap.pellet.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:64) at org.mindswap.pellet.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:157) at org.mindswap.pellet.ABox.isConsistent(ABox.java:1423) at org.mindswap.pellet.ABox.isConsistent(ABox.java:1260) at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1987) at org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2061) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:247) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:230) at org.mindswap.pellet.jena.PelletInfGraph.validate(PelletInfGraph.java:564) at com.hp.hpl.jena.rdf.model.impl.InfModelImpl.validate(InfModelImpl.java:111)