[ 
https://issues.apache.org/jira/browse/PIG-4603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589436#comment-14589436
 ] 

Gleb Smirnov commented on PIG-4603:
-----------------------------------

Fair point here. A simple solution that comes to mind would be to have another 
class that is subscribed for notifications and holds a weak reference to the 
SpillableMemoryManager. All the notifications are delegated there. As soon as 
the SpillableMemoryManager itself becomes weakly reachable, 
removeNotificationListener may be invoked. This is somewhat not elegant, but 
would save the skin of people who use Pig inside of an application server.

> Classloader leak in SpillableMemoryManager
> ------------------------------------------
>
>                 Key: PIG-4603
>                 URL: https://issues.apache.org/jira/browse/PIG-4603
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.15.0
>            Reporter: Gleb Smirnov
>            Assignee: Rohini Palaniswamy
>
> In the constructor of {{SpillableMemoryManager}}, a {{NotificationListener}} 
> is added to the {{MemoryMXBean}}. This listener is never removed, even if the 
> application is re-deployed.
> This results in the instance {{SpillableMemoryManager}} being still reachable 
> after a redeploy. This results in its class being reachable, which results in 
> the classloader being reachable, along with all the classes in it.
> This leads to metaspace OutOfMemoryErrors.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to