您好,登錄后才能下訂單哦!
之前因?yàn)?/span>java.lang.OutOfMemoryError: unable to create new native thread
設(shè)置了Xss參數(shù),見http://zouqingyun.blog.51cto.com/782246/1879975
nodeManager仍然出現(xiàn)該異常,同時(shí)map-reduce的任務(wù)中也出現(xiàn)該異常
二、一些現(xiàn)象
跑了一個(gè)map-reduce任務(wù),這個(gè)任務(wù)處理的都是小文件,最后生成了2萬(wàn)多個(gè)map任務(wù)。這個(gè)job中許多任務(wù)出現(xiàn)java.lang.OutOfMemoryError: unable to create new native thread
,觀察了這個(gè)job的一些任務(wù),發(fā)現(xiàn)這個(gè)任務(wù)的thread stack持續(xù)增長(zhǎng),最后有7000多個(gè)thread,最后導(dǎo)致java.lang.OutOfMemoryError: unable to create new native thread
,因?yàn)槊總€(gè)map任務(wù)分配的內(nèi)存為800m,ThreadStackSize是默認(rèn)值1024k,最后導(dǎo)致內(nèi)存耗盡。任務(wù)的線程棧中持續(xù)一下輸出:
"Thread-3689" daemon prio=10 tid=0x00007fb6bf364000 nid=0x2331 in Object.wait() [0x00007fb5b9b94000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:638) - locked <0x00000000f89800d0> (a java.util.LinkedList) "Thread-3688" daemon prio=10 tid=0x00007fb6bf362000 nid=0x10a9 in Object.wait() [0x00007fb5b9c95000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:638) - locked <0x00000000f89701c0> (a java.util.LinkedList) "Thread-3687" daemon prio=10 tid=0x00007fb6bf35a800 nid=0xf23 in Object.wait() [0x00007fb5b9d96000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:638) - locked <0x00000000f89681c0> (a java.util.LinkedList) "Thread-3686" daemon prio=10 tid=0x00007fb6bf358800 nid=0xde9 in Object.wait() [0x00007fb5b9e97000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:638)
三、猜測(cè)
1、nodemanager的異常可能與這個(gè)有關(guān),當(dāng)該map-reduce所有任務(wù)調(diào)度到一臺(tái)機(jī)器(大概40個(gè)container),每個(gè)container中任務(wù)都生成7000個(gè)thread(生成很多小文件?)。導(dǎo)致耗盡max user processes(262144)。但nodemanger需要new thread的時(shí)候,出現(xiàn)java.lang.OutOfMemoryError: unable to create new native thread。(ps 昨天這個(gè)任務(wù)確實(shí)在定時(shí)跑)
2、可能是hadoop/yarn某些地方的內(nèi)存溢出問題。參見一個(gè)類似的問題。https://issues.apache.org/jira/browse/YARN-4581
四、后記
hadoop處理大量小文件,要使用org.apache.hadoop.mapreduce.lib.input.CombineTextInputFormat,并設(shè)置mapreduce.input.fileinputformat.split.maxsize = 5147483648
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。