During JVM stop, few of the thread pool
are not getting closed properly. Due to this Perm Gen leak
happens as class loader is restricted from being Garbage collected.
These thread pool are opened by 3rd party application (Elasticsearch) and I do not have any direct control over it other than client
instance.
client
instance do provide methods for shutting down
the scheduler
and thread pool
but this error is not getting rectified. '
Please help. Is there any way we can get instance of 3rd Parties
ScheduledThreadPoolExecutor
and shutdown it through Java application?
Answer solved by referring these two articles:
Plumbr tool helped in providing the class loader leak reference and details of thread causing the memory leak.
Article 1: This article suggested how to find out who created the Thread which is causing the memory leak.
how to find out who create a thread in java?
Answer by @Aaron Digulla saved me. Especially 4th and 5th point.
Article 2: This article suggested how to close the client.