oracle / oci-hdfs-connector

HDFS Connector for Oracle Cloud Infrastructure
https://cloud.oracle.com/cloud-infrastructure
Other
27 stars 26 forks source link

Thread Leak in BmcFileSystem causing OutOfMemory #109

Open eaugene opened 1 week ago

eaugene commented 1 week ago

Even after closing multiple BMCFileSystem instances which we create in our application , the bmcs-hdfs-readahead threads are seemed to be in parked state & with each new instance of BMCFileSystem creation , we can see the thread count is going up and eventually leading to OOM .

Eg :


"bmcs-hdfs-readahead-0" - Thread t@1660
--
java.lang.Thread.State: WAITING
at java.base@11.0.23/jdk.internal.misc.Unsafe.park(Native Method)
- parking to wait for <2cc89094> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.base@11.0.23/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.base@11.0.23/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
at java.base@11.0.23/java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
at java.base@11.0.23/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
at java.base@11.0.23/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
at java.base@11.0.23/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.23/java.lang.Thread.run(Thread.java:829)
 
Locked ownable synchronizers:
- None

Fixes :

cc : @yanhaizhongyu