메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


Kafka로부터 메세지를 받는 spark기반 client프로그램을 구동시 처리할 메세지가 갑자기 증가하게 되면 OutOfMemoryError가 발생하면서 많은 수의 hs_err_pid???.log파일이 생성되며 JVM관련 명령어(예, jps)를 실행하면 "java.lang.OutOfMemoryError: unable to create new native thread"의 오류가 발생할 수 있는데 이것은 NIO관련 라이브러리가 디폴트로 0(무제한)의 DirectMemoryBuffer를 제공함으로서 모든 메모리를 소진하기 때문이다. 이럴때는 파일엑세스처리가 많이 일어나는 JVM을(예, tomcat)기동시 -XX:MaxDirectMemorySize(예, 2G(2147483648), 2*1024*1024*1024)등을 지정하여 무제한으로 사용되지 않도록 설정하고 재기동해준다.


*참고(Tomcat 메모리 CATALINA_OPTS 설정) : http://starplaying.tistory.com/446


-------------------오류내용--------------------

-bash-4.1$ jps

Error occurred during initialization of VM

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


------------------폴더에 오류로그 파일들도 다수 생성된다. ----------

hs_err_pid11579.log  hs_err_pid14873.log  hs_err_pid3724.log  hs_err_pid5596.log  hs_err_pid69979.log  hs_err_pid8240.log   hs_err_pid8859.log  hs_err_pid9857.log

번호 제목 날짜 조회 수
41 Spark에서 Serializable관련 오류및 조치사항 2017.04.21 5028
40 spark-sql실행시 Caused by: java.lang.NumberFormatException: For input string: "0s" 오류발생시 조치사항 2016.06.09 2865
39 VisualVM 1.3.9을 이용한 spark-submit JVM 모니터링을 위한 설정및 spark-submit실행 옵션 2016.10.28 2118
38 Spark 2.1.1 clustering(5대) 설치(YARN기반) 2016.04.22 2050
37 spark stream처리할때 두개의 client프로그램이 동일한 checkpoint로 접근할때 발생하는 오류 내용 2018.01.16 1167
36 "Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources"오류 발생시 조치사항 2016.05.25 1132
35 spark-env.sh에서 사용할 수있는 항목. 2016.05.24 853
» java.lang.OutOfMemoryError: unable to create new native thread오류 발생지 조치사항 2016.10.17 742
33 Spark 1.6.1 설치후 HA구성 2016.05.24 725
32 Apache Spark와 Drools를 이용한 CEP구현 테스트 2016.07.15 701
31 kafka로 부터 메세지를 stream으로 받아 처리하는 spark샘플소스(spark의 producer와 consumer를 sbt로 컴파일 하고 서버에서 spark-submit하는 방법) 2016.07.13 698
30 spark-submit 실행시 "java.lang.OutOfMemoryError: Java heap space"발생시 조치사항 2018.02.01 631
29 spark-shell실행시 "A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection."오류가 발생하는 경우 해결방법 2016.05.20 625
28 Scala에서 countByWindow를 이용하기(예제) 2018.03.08 612
27 spark client프로그램 기동시 "Error initializing SparkContext"오류 발생할때 조치사항 2016.05.27 610
26 spark-sql실행시 The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH오류 발생시 조치사항 2016.06.09 575
25 Windows7 64bit 환경에서 Apache Spark 2.2.0 설치하기 2017.07.26 566
24 It is indirectly referenced from required .class files 오류 발생시 조치방법 2017.03.09 563
23 spark에서 hive table을 읽어 출력하는 예제 소스 2017.03.09 559
22 Caused by: java.lang.ClassNotFoundException: org.apache.spark.Logging 발생시 조치사항 2017.04.19 508
위로