On Tue, 2010-12-14 at 06:07 +0100, Cameron Hurst wrote: [Cameron expected 150MB overhead]
> As I start to index data and passing queries to the database I notice a > steady rise in the RAM but it doesn't stop at 150MB. If I continue to > reindex the exact same data set with no additional data entries the RAM > continuously increases. I stopped looking as the RAM increased beyond > 350MB and started to try and debug it and can't find anything obvious > from my beginners view point. The JVM tries to find a balance between garbage collection and memory usage. If your memory allocation is 512MB, it makes perfectly sense for the JVM to allocate 350 MB, although it might be capable of getting by with 150MB. If you want to find a "minimum" (or rather the smallest possible memory allocation that does not result in excessive performance degradation), you'll have to start with different maximum memory allocations and measure. Do keep a close eye on garbage collection time when you do this. I recommend visualvm with the Visual GC plugin for this.