사용자 도구

사이트 도구


java:template_engine:freemarker

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
java:template_engine:freemarker [2015/11/23 00:08]
kwon37xi [null 기본값]
java:template_engine:freemarker [2015/11/26 21:14] (현재)
kwon37xi [Template Cache]
줄 91: 줄 91:
 cfg.setNumberFormat("0.######");  // now it will print 1000000 cfg.setNumberFormat("0.######");  // now it will print 1000000
 </code> </code>
 +==== Template Cache ====
 +캐시를 지정해 속도를 높여야 한다.
 +[[http://freemarker.incubator.apache.org/docs/pgui_config_templateloading.html|Template loading]] 참조.
  
 +<code java>
 +cfg.setTemplateUpdateDelayMilliseconds(3600000L); // 1hour 템플릿 파일 갱신 여부 체크 주기
 +cfg.setCacheStorage(new MruCacheStorage(500, 5000)); // strong 500, soft 5000
 +</code>
 +
 +  * ''MruCacheStorage'' 캐싱 전략은 ''strong''에 템플릿을 캐시하다가 꽉차면 least recently used 템플릿을 ''soft'' 영역으로 옮긴다.
 +    * ''strong'' : JVM Full GC 시에도 GC 대상에 들어가지 않는다.
 +    * ''soft'' : JVM Full GC 시에 GC 대상이 된다.
 +    * 기본값은 ''strong=0'', ''soft=Integer.MAX_VALUE''
 +    * ''strong''을 템플릿 갯수와 Heap 할당량에 따라 명시적으로 지정해주는 것이 좋다.
  
java/template_engine/freemarker.1448206692.txt.gz · 마지막으로 수정됨: 2015/11/23 00:08 저자 kwon37xi