Open HenrikJannsen opened 5 months ago
Part of the problem with growing threads was caused by a bug in the InventoryRequestService, fixed in https://github.com/bisq-network/bisq2/pull/1799
With v2.0.1 I could not observe growth of nr. of threads anymore. But we still should find a better solution for the Scheduler.
The Scheduler creates a new ScheduledExecutorService each time it gets created. We should avoid creating new ScheduledExecutorServices each time. Using a pool does not work well as there is only one API with a fixed pool core pool size but it is hard to estimate the right number for that. We can use a cache where idle ScheduledExecutorService instances are retired and reused when a new Scheduler is created.