'String constant pool'에 해당되는 글 1건

  1. 2014.01.24 [Java] String constant pool

[Java] String constant pool

Java 2014. 1. 24. 05:07

String constant pool


To cut down the number of String object created, JVM maintains a special memory called "String literal poolor "String constant pool". Each time your code creates a string literal, the JVM checks the string literal pool first. If the string already exists in the pool, a reference is returned. JVM keeps at most one object of any String in this pool.

많은 String object가 만들어지는 것을 방지하기 위해서 JVM은 String literal pool 혹은 String constant pool로 불리는 특별한 메모리를 유지합니다. 당신의 코드가 문자열 리터럴을 만들때마다 JVM은 우선 String literal pool을 체크하게 됩니다. 만약 문자열이 풀안에 존재한다면, 참조값이 반환됩니다. JVM은 이 pool에서 최대 하나의 String object를 유지합니다.


Vasudevan, N. (2012). STRING LITERAL POOL. Retrieved from http://theopentutorials.com/tutorials/java/strings/string-literal-pool/


'Java' 카테고리의 다른 글

[Java] list와 향상된 for문  (2) 2014.02.09
[Java] 2차원 배열의 길이  (0) 2014.02.08
[Java] String과 StringBuffer의 차이점  (0) 2014.01.24
[Java] 메모리 관점에서 본 String  (0) 2014.01.24
[Java] 상수(Constant)  (0) 2014.01.24
Posted by marvell
,