내용으로 건너뛰기
권남
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
java:threadlocal
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== Java ThreadLocal ====== * [[https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html|ThreadLocal]] Each thread holds an implicit reference to its copy of a thread-local variable as long as the thread is alive and the ThreadLocal instance is accessible; after a thread goes away, all of its copies of thread-local instances are subject to garbage collection (unless other references to these copies exist). ===== withInitialValue ===== * 초기값을 생성하는 lambda 를 지정해두면 최초에 값이 없을 때에 적절한 초기값을 제공해준다. * ''remove()'' 를 호출해서 초기값이 없어진 상태에서 다시 ''get()''을 하면 ''withInitialValue''로 설정했다면 다시 초기값을 생성해서 반환해준다. ===== 참조 ===== * [[http://stackoverflow.com/questions/17968803/threadlocal-memory-leak|java - ThreadLocal & Memory Leak]]
java/threadlocal.txt
· 마지막으로 수정됨: 2024/12/11 20:05 저자
kwon37xi
문서 도구
문서 보기
이전 판
역링크
맨 위로