Hi all,

On my environment I have created a class in order to encapsulate access
to `Dataset` and `Model`s stored. I didn't realize that the
`QueryExecution` instance was not collected by the GC and it seems that
could lead to memory leak.  In this sense I found that
`ResultSetFactory.copyResults()` detach the `ResultSet` from the
QueryExecution.

My concern now now is about performance: ¿Is it really consuming to
perform a copy of thousands of data? Would it be better to create
another class acting as a wrapper for the Jena `QueryExecution` and just
only read the `ResultSet` once.

This is the kind of thing I'm referring to.

```java
// query is a Query
// ts is the class encapsulating the management of the triple store
SparqlExecutor exec = new SparqlExecutor(query, ts);
ResultSet res = exec.execute();
// Do what ever with the resultset
exec.close()

```

Within the `execute` function I manage the transaction, get the
corresponding named graphs, etc.

Thanks a lot.

Jorge

P.S.: It is difficult to explain things without disclosing the code :(
sorry.

Reply via email to