logo

Hibernate - QueryPlanCache Memory Leak 해결하기!

language-logoHibernate

• 팀에서 관리하던 security-alarm-api에서 OOM(Out of Memory) 문제가 발생했고, 이를 해결하기 위해 HeapSize와 HeapDump를 확인했다.
• HeapSize가 256m로 설정되어 있었고, HeapDump를 통해 SessionFactoryImpl이 185MB를 차지하고 있음을 확인했다.
• Hibernate의 QueryPlanCache에서 발생한 문제로, 특히 Where In절에 많은 리스트를 넣을 때 메모리 누수가 발생했다.
• 이를 해결하기 위해 in_clause_parameter_padding, plan_cache_max_size, plan_parameter_metadata_max_size 옵션을 추가하고, HeapSize를 512m으로 증량하여 문제를 해결하였다.

thumbnail
북마크
공유하기
신고하기
4분 분량
조회수 218
profile-imageVioletbeach
2년 전
Copyright © 2025. Codenary All Rights Reserved.