elasticsearch-jdbc icon indicating copy to clipboard operation
elasticsearch-jdbc copied to clipboard

java.lang.OutOfMemoryError: unable to create new native thread

Open seaking opened this issue 9 years ago • 9 comments

java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) ~[?:1.8.0_91] at java.lang.Thread.start(Thread.java:714) ~[?:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950) ~[?:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1357) ~[?:1.8.0_91] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[?:1.8.0_91] at org.xbib.pipeline.SimplePipelineExecutor.execute(SimplePipelineExecutor.java:105) ~[elasticsearch-jdbc-2.2.1.0.jar:?] at org.xbib.pipeline.MetricSimplePipelineExecutor.execute(MetricSimplePipelineExecutor.java:52) ~[elasticsearch-jdbc-2.2.1.0.jar:?] at org.xbib.tools.JDBCImporter.execute(JDBCImporter.java:237) ~[elasticsearch-jdbc-2.2.1.0.jar:?] at org.xbib.tools.JDBCImporter.run(JDBCImporter.java:146) [elasticsearch-jdbc-2.2.1.0.jar:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_91] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_91]


Thread

[root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 84 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 84 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 86 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 86 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 88 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 96 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 110 [root@VM-172-31-105-120 ~]#pstree -p 18825|wc -l 118

the thread continued increase ,final java.lang.OutOfMemoryError: unable to create new native thread。

this is my jdbc.config-->

"user" : "order", "password" : "order", "schedule": "*/3 * * * * ?", "threadpoolsize":1, "metrics" : { "enabled" : true },

seaking avatar May 31 '16 03:05 seaking

i meet this problem too

yale8848 avatar Jun 30 '16 03:06 yale8848

me too, how to resolve this?

rainkong avatar Oct 25 '16 03:10 rainkong

can anyone help?

rainkong avatar Oct 25 '16 03:10 rainkong

me too, how to resolve this?

nidonglin avatar Oct 25 '16 04:10 nidonglin

I'm guessing these issues where never resolved but like the people before me, I shall ask too. Is there any fix for this? I have the exact same issue. I can watch the memory usage going up and up until it uses all the server memory. I've tried setting Java Heap variables etc and this does not help, I've increased the schedule interval and this also does not help. This is using V 2.3.4.1

jonday-simitive avatar Mar 22 '17 16:03 jonday-simitive

facing Same issue as above

luckypur avatar May 10 '17 03:05 luckypur

I didn't ever find an actual fix for the memory leak. I just restart the river every hour using a cron job which allows the memory to be released.

jonday-simitive avatar May 10 '17 09:05 jonday-simitive

Commit https://github.com/jprante/elasticsearch-jdbc/commit/ee7ec72d92fa2ee5da9356c86201fa8b54d8a481 fixes the issue.

jprante avatar May 10 '17 19:05 jprante

hi jprante I use the 'Commit ee7ec72 fixes the issue' code in script . but when script runnng once,the thread +1. use ' pstree -p 32063 |wc -l ' one times plus 1 , a few days later , this issue will reappeared

hongjunsu avatar Jun 09 '17 07:06 hongjunsu