문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:options [2017/02/07 10:08] kwon37xi |
java:options [2020/08/13 13:44] kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Oracle(SUN) JVM Options ====== | ====== Oracle(SUN) JVM Options ====== | ||
* JVM 기본 옵션 출력< | * JVM 기본 옵션 출력< | ||
+ | java -XX: | ||
+ | // or | ||
java -XX: | java -XX: | ||
</ | </ | ||
+ | * 메모리 관련 항목은 '' | ||
* [[http:// | * [[http:// | ||
+ | * [[https:// | ||
* [[http:// | * [[http:// | ||
* '' | * '' | ||
줄 15: | 줄 19: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ===== -XX: | ||
+ | * Oracle JVM 에서 예외가 발생하여 로그로 남겼는데, | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | >> The compiler in the server VM now provides correct stack backtraces for all " | ||
+ | |||
+ | >> built-in 예외가 반복적으로 발생할 경우 메소드를 다시 컴파일 하여 성능을 높일 수 있다. 재컴파일 이후, 컴파일러는 미리 할당된 예외를 던지는데, | ||
+ | |||
+ | 원천적이로 이 기능을 끄려면 '' | ||
+ | |||
+ | 이 경우, **동일 JVM에서 비슷하게 발생한 다른 에러 로그를 찾아보면 과거에 발생했던 에러 로그에서 stacktrace를 찾을 수 있다.** 혹은 JVM을 다시 실행해서 재현해봐도 전체 stacktrace를 얻을 수 있다. | ||
+ | |||
+ | 재현해보기 | ||
+ | <code java> | ||
+ | public class NpeThief { | ||
+ | public void callManyNPEInLoop() { | ||
+ | for (int i = 0; i < 1000000; i++) { | ||
+ | try { | ||
+ | ((Object)null).getClass(); | ||
+ | } catch (Exception e) { | ||
+ | // stacktrace길이가 2 이다가 어느 순간 0으로 바뀐다. | ||
+ | System.out.println(e.getStackTrace().length); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | public static void main(String ... args) { | ||
+ | NpeThief thief = new NpeThief(); | ||
+ | thief.callManyNPEInLoop(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== -XX: | ||
+ | * '' | ||
+ | |||
+ | ===== 참조 ===== | ||
+ | * [[https:// | ||
+ | * [[https:// |