Odi's astoundingly incomplete notes
New entries | CodeMemory use of the JBoss DB statement cache
JBoss
The tricky thing is that the memory will not be used until your server uses many connections. That means when your load is high. That's exactly the situation when you simply can't spend memory on silly caches.
*-ds.xml
files let you define a statement cache for PreparedStatement objects:
<prepared-statement-cache-size>16</prepared-statement-cache-size>Be not too adventurous with the value you set there! In one of my production systems I had a pool of 50 Oracle connections and 256 statement cache (per connection). That leads to 12'800 cached statements. Those statement objects must be surprisingly large, as cutting the value down to 16 from 256 immediately led to 1GB less heap use! That gives around 90KB per statment object.
The tricky thing is that the memory will not be used until your server uses many connections. That means when your load is high. That's exactly the situation when you simply can't spend memory on silly caches.
Add comment