Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Thu, 11 Jan 2024 12:07:51 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3089: Metaspace Memory leak: Thread.inheritedAccessControlContext In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 1887026162 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2024-01-11T12:08:07Z X-GitHub-Issue: 3089 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3089#issuecomment-1887026162 Content-Type: text/plain; charset=utf-8 @embuc, just for reference, if the `LazyCleaner` queue is not empty, then it means there are unclosed connections. In other words, it means the application leaks connections (or it still uses the connections). If the application closed connections properly, there would be nothing to clean in the first place. You might debug that by adding `logUnclosedConnections=true` connection parameters, and then check logs or `PgConnectionCleaningAction.openStackTrace` field for the stacktrace which opened the connection that was eventually left unclosed.