Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
We had a small memory leak in the code base. Namely, there have been some
threadpools in use but not shutdown when they have been no longer needed.
Result was that the threads and the parent threads have been kept alive
which lead to hundreds of stale threads over the course of several days.
  • Loading branch information
freimair committed Dec 3, 2019
1 parent 037f167 commit 5f37be1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions p2p/src/main/java/bisq/network/p2p/network/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ private void doShutDown(CloseConnectionReason closeConnectionReason, @Nullable R

//noinspection UnstableApiUsage
MoreExecutors.shutdownAndAwaitTermination(singleThreadExecutor, 500, TimeUnit.MILLISECONDS);
MoreExecutors.shutdownAndAwaitTermination(bundleSender, 500, TimeUnit.MILLISECONDS);

log.debug("Connection shutdown complete " + this.toString());
// Use UserThread.execute as its not clear if that is called from a non-UserThread
Expand Down

0 comments on commit 5f37be1

Please sign in to comment.