Open chenejac opened 5 years ago
Andrew Woods said:
Which class(es) are you suggesting being updated?
alessandro galasso said:
[~accountid:60785ded115da6006f540529] this class should be fixed because sb go easlily out of bound
//class:
Vitro/api/src/main/java/edu/cornell/mannlib/vitro/webapp/dao/jena/RDFServiceGraph.java
// method
private synchronized String serializeGraph(Graph graph) {
StringBuilder sb = new StringBuilder();
Iterator<Triple> tripIt = graph.find(null, null, null);
while(tripIt.hasNext()) {
serialize(sb.append(" \n"), tripIt.next());
}
return sb.toString();
}
alessandro galasso (Migrated from VIVO-1669) said:
The append method of StringBuilder has a character count max limit of "Integer.MAX_VALUE",
so the serialization in serializeGraph(Graph graph) is very likely to go in out of memory or out of bound.
Tests based on real production data, with an upload of 2gb size rdf file show the need to adress this issue,
something like this shoud do the job: