You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 29, 2021. It is now read-only.
I have identified what looks like a substantial resource leak in the MarkLogicRepository class (part of the Marklogic-rdf4j code).
I’m using the databaseClient constructor (MarkLogicRepository:170), which sets the databaseClient, securityContext and client attributes in the constructor based on the passed-in databaseClient.
As part of the setup process, initialize() is then called, which calls initializeInternal (markLogicRepository:208) which basically does nothing as everything is already set.
At various points, getConnection (MarkLogicRepository:284) is called, which on line 289 ALWAYS calls getMarkLogicClient.
getMarkLogicClient (MarkLogicRepository:299) ALWAYS creates a new DatabaseClient instance and corresponding MarkLogicClient instance rather than using the instances set in the constructor.
I think this is a resource leak because DatabaseClient instances need to be released when we’re done with them, and by constantly overwriting a DatabaseClient instance, the code does not do that.
I suspected a possible resource leak when I noticed that my main() program doesn’t terminate when run in eclipse, it just hangs forever even after completing all the application cleanup scripts. The debugger reveals that numerous databaseClient-related threads are still running, even though the cleanup code properly calls MarkLogicRepository.shutdown, which ought to clean up the DatabaseClient.
While I can’t be sure this is the cause, the getMarkLogicClient code looks very suspicious to me. Why doesn’t it just return this.client? All the constructors appear to initialize it properly (with the help of initialize()) so it shouldn’t need to be overwritten with every call to getConnection, should it?
The text was updated successfully, but these errors were encountered:
From client:
I have identified what looks like a substantial resource leak in the MarkLogicRepository class (part of the Marklogic-rdf4j code).
I’m using the databaseClient constructor (MarkLogicRepository:170), which sets the databaseClient, securityContext and client attributes in the constructor based on the passed-in databaseClient.
As part of the setup process, initialize() is then called, which calls initializeInternal (markLogicRepository:208) which basically does nothing as everything is already set.
At various points, getConnection (MarkLogicRepository:284) is called, which on line 289 ALWAYS calls getMarkLogicClient.
getMarkLogicClient (MarkLogicRepository:299) ALWAYS creates a new DatabaseClient instance and corresponding MarkLogicClient instance rather than using the instances set in the constructor.
I think this is a resource leak because DatabaseClient instances need to be released when we’re done with them, and by constantly overwriting a DatabaseClient instance, the code does not do that.
I suspected a possible resource leak when I noticed that my main() program doesn’t terminate when run in eclipse, it just hangs forever even after completing all the application cleanup scripts. The debugger reveals that numerous databaseClient-related threads are still running, even though the cleanup code properly calls MarkLogicRepository.shutdown, which ought to clean up the DatabaseClient.
While I can’t be sure this is the cause, the getMarkLogicClient code looks very suspicious to me. Why doesn’t it just return this.client? All the constructors appear to initialize it properly (with the help of initialize()) so it shouldn’t need to be overwritten with every call to getConnection, should it?
The text was updated successfully, but these errors were encountered: