New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Leak: Database reference held by a ReplicatorListenerThread after close #2
Comments
Hi @fijemax, as far as I know, the local database participating in the replication has to wait for all replicators properly stopped before it can be closed. |
Before closing the database I sync my thread with the replicators stop. |
Have you discarded all replicator references too? I don't think Java itself was designed with this in mind, but the thread you mention is started via a single thread executor that is referenced by the replicator. My assumption is that it will shut down once the handle is garbage collected (as part of the Replicator garbage collection) |
We are seeing this issue as well. Explicitly calling stop and then discarding the reference. Replicators do not release resources when they are finished. As such for long-running applications, the replicators end up filling memory and causing an application crash. We declare the replicator
Initialize the replicator
For the test case we run the following code every 5 seconds:
The following is the thread pool state for the application after some time:
Please let me know if you need a more detailed senario or specific logs. |
This issue is also tracked in https://issues.couchbase.com/browse/CBL-15 |
This issue has been resolved. The fix is in couchbase-lite-java:f020addb3aeeec67b98f32be and was released with CBL 2.6.x |
Hello,
Using: CB 2.1.0
I inspect my app memory after stop my two replicators and closing and releasing my Database.
I observed that the both replicators are keep by a ReplicatorListenerThread and by the same way the Database reference's is keep too.
Note:
All references at any couchbase Documents or Database are release by my app.
I force Garbage Collecte to release memory.
The database was closed after both Replication has stopped properly.
This is memory leak or normal behavior ?
The text was updated successfully, but these errors were encountered: