java - High memory usage when using hibernate -
i code server side application java run on linux server. utilize hibernate open session database, utilize native sql query , close session try, catch, finally.
my server query db using hibernate high frequency.
i define maxheapsize 3000m utilize 2.7gb on ram, can decrease slower increase. sometime grow 3.6gb memory usage, more maxheapsize define when start.
when memory used 3.6gb, seek dump -jmap command , got heapdump size of 1.3gb only.
im using eclipse mat analyse it, here dominator tree mat think hibernate problem, have many org.apache.commons.collections.map.abstractreferencemap$referenceentry this. maybe cant dispose garbage collection or can slow.
how can prepare it?
you have 250k entries in in query list. native query set database knees. oracle limits in query listing 1000 performance reasons should same.
giving more ram not going solve problem, need limit select/updates batches of @ 1000 entries.
set:
"hibernate.query.plan_cache_max_soft_references" "hibernate.query.plan_cache_max_strong_references" java hibernate memory-leaks out-of-memory heap-dump
No comments:
Post a Comment