[
https://issues.apache.org/jira/browse/PIG-4603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rohini Palaniswamy resolved PIG-4603.
-------------------------------------
Resolution: Won't Fix
Fix Version/s: (was: 0.16.0)
I could not find an easy fix for this.
NotificationEmitter.removeNotificationListener(NotificationListener listener)
requires the exact object to be passed to it. If it allowed registering of
listeners with a unique id/name in addition to the object, it would have been
easy to remove the older one before registering the new one. Even otherwise it
is a bad idea if more than one live webapp has to be supported.
The clean solution would be to implement
ServletContextListener.contextDestroyed and call
((NotificationEmitter)ManagementFactory.getMemoryMXBean()).removeNotificationListener(SpillableMemoryManager.getInstance(),
null, null); in that by whoever is packaging pig as a webapp. Since that is
outside of the scope of Pig, I am closing this as Won't Fix.
> 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)