JVM 메모리 구조와 클래스 로딩 (Constant Pool과 intern())
·
TIL
Runtime Data AreaJVM이 실행 시 메모리 영역 1. Method Area - 클래스 로딩 시 클래스 메타정보, static 변수, constant pool 복사본이 저장됨 - Runtime Constant Pool은 이 영역 일부로 포함됨 - Java 8부터는 Metaspace라는 native 영역에 저장됨public class StaticExample { static String val = "loaded"; static { System.out.println("StaticExample loaded!"); }}public class LoadTest { public static void main(String[] args) throws Exception { ..