티스토리 뷰

hs_err_pid 파일은 JVM이 어떤 이유에 의해 강제로 종료되면서 왜 종료되었는지 단서를 남긴 파일이다. 

[13:50:05.414][INFO ]19108[org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.prepareWebApplicationContext:line290] - Root WebApplicationContext: initialization completed in 655 ms
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000093b00000, 4005#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 400556032 bytes for Failed to commit area from 0x0000000093b00000 to 0x00000000ab900000 of length 400556032.
56032, 0) failed; error='�� �۾��� �Ϸ��ϱ� ���� ����¡ ������ �ʹ� �۽��ϴ�' (DOS error/errno=1455)
# An error report file with more information is saved as:
# C:\project\workspace\demo\hs_err_pid19108.log

tomcat을 기동할때 위와 같은 메세지를 내면서 기동이 안된다. 위와 같은 경우는 딱 봐도 이유가 명확하기에 조치하기가 어렵지 않지만 그 외에 문제로 JVM이 종료되게 되면 찾기 어려울수도 있다. 이렇게 콘솔로도 에러가 나오고 맨 아래줄에 있는것처럼 hs_err_pid.log 파일로도 기록을 남겨준다. 

 

hs_err_pid.log

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 400556032 bytes for Failed to commit area from 0x0000000093b00000 to 0x00000000ab900000 of length 400556032.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
#   JVM is running with Unscaled Compressed Oops mode in which the Java heap is
#     placed in the first 4GB address space. The Java Heap base address is the
#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
#     to set the Java Heap base and to place the Java Heap above 4GB virtual address.
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (t:/workspace/open/src/hotspot/os/windows/os_windows.cpp:3269), pid=19108, tid=7396
#
# JRE version: OpenJDK Runtime Environment (11.0+28) (build 11+28)
# Java VM: OpenJDK 64-Bit Server VM (11+28, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
---------------  S U M M A R Y ------------
...
---------------  T H R E A D  ---------------
...
---------------  P R O C E S S  ---------------
...
---------------  S Y S T E M  ---------------
...

이런 식으로 파일 맨 위에 원인과 해결책에 대해 기술이 되어 있다. 그 밑으로도 상당히 많은 내용이 들어있는 로그 파일이지만 정 모르겠을때 말고는 딱히 볼 필요는 없을것 같다. 

 

이 hs_err_pid 파일의 위치는 기본적으로 프로젝트의 root 하위에 생성이 되도록 되어 있다. 물론 이 파일의 위치나 이름도 JVM option을 통해 다음과 같이 변경할 수 있다. 

-XX:ErrorFile=C:/temp/hs_err_pid%p.log

 이렇게 설정하고 기동하고 또 JVM이 죽는다면 C:/temp 하위에서 hs_err_pid 파일을 찾을 수 있다. 

 

끝!

댓글
최근에 올라온 글
최근에 달린 댓글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31