====== Java Memory Leak 메모리 누수 ====== ===== Java Memory Leak 관련자료 ===== * [[http://apmblog.dynatrace.com/2015/07/14/how-to-identify-objects-causing-memory-leaks/|How to identify objects causing memory leaks]] * [[https://dzone.com/articles/memory-problems-how-to-identify-a-java-memory-leak|Memory Problems: How to Identify a Java Memory Leak - DZone Performance]] * [[http://www.javacodegeeks.com/2015/11/java-memory-architecture-model-garbage-collection-and-memory-leaks.html|Java Memory Architecture (Model), Garbage Collection and Memory Leaks | Java Code Geeks]] * [[http://www.munzandmore.com/2011/ora/memleak|Detect your Memory Leaks by counting Surviving Generations: Size matters! — munz & more]] ===== List.subList() ===== * [[http://docs.oracle.com/javase/6/docs/api/java/util/AbstractList.html#subList%28int,%20int%29|AbstractList.subList(int,int)]] * ''subList()''는 원본 리스트에 대한 백 레퍼런스를 가지고 있는 원본 리스트의 View이다. * [[java:ehcache|ehcache]]에 subList로 생성한 객체를 저장하면 메모리 누수가 발생한다. * [[http://stackoverflow.com/questions/4179236/does-the-list-sublist-method-prevent-garbage-collection-of-the-rest-of-the-lis|java - Does the List subList() method prevent garbage collection of the rest of the list?]] * 해결책 return new ArrayList(anotherList.subList(0, 5));