Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
All
-
None
Description
There is a memory leak of previous closed DefaultSessions. It can be reproduced by this:
public static void main(String[] args) throws InterruptedException { Semaphore sema = new Semaphore(20); for (int i = 0; i < 10000; i++) { new Thread(() -> { try { sema.acquire(); try(CqlSession session = CqlSession.builder() .withCloudSecureConnectBundle(Paths.get("bundle.zip")) .withAuthCredentials("token", "<some token here>") .build()) { // Do stuff } } catch (Exception e) { System.out.println(e); } finally { sema.release(); } }).start(); } }
On initial investigation, it seems like MicrometerMetricUpdater.initializeGauge() uses Gauge.builder() using Supplier . This creates a strong reference that is causing the issue.
Attachments
Attachments
Issue Links
- links to