You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use this library in our project and found a memory leak.
Heap dumps were taken and it was discovered that there were many many instances of BalancedResolverGroup in EpollEventLoop.terminationFuture.listeners.listeners. It doesn't help that a new BalancedResolverGroup is created whenever a connection is acquired. Whenever BalancedResolverGroup.getResolver() is called, a new listener is added to the EventLoop's termination listeners.
see https://github.com/netty/netty/blob/netty-4.1.65.Final/resolver/src/main/java/io/netty/resolver/AddressResolverGroup.java#L89
Bug Report
Current Behavior
Stack trace
Table schema
Input Code
-- your SQL here;
Steps to reproduce
Input Code
// your code here;
Expected behavior/code
We use this library in our project and found a memory leak.
Heap dumps were taken and it was discovered that there were many many instances of
BalancedResolverGroup
inEpollEventLoop.terminationFuture.listeners.listeners
. It doesn't help that a newBalancedResolverGroup
is created whenever a connection is acquired. WheneverBalancedResolverGroup.getResolver()
is called, a new listener is added to the EventLoop's termination listeners.see https://github.com/netty/netty/blob/netty-4.1.65.Final/resolver/src/main/java/io/netty/resolver/AddressResolverGroup.java#L89
Possible Solution
AddressResolverGroup
should almost always be a singleton.This line should use the static instance (
BalancedResolverGroup.INSTANCE
) rather than instantiating.https://github.com/pgjdbc/r2dbc-postgresql/blob/v0.8.8.RELEASE/src/main/java/io/r2dbc/postgresql/client/ReactorNettyClient.java#L392
Versions
Additional context
The text was updated successfully, but these errors were encountered: