When I have seen that sawtooth pattern before, it was because the cache hit rate was low. Items ejected from the cache become garbage. If that happens at a fairly constant rate, you get that slope of increasing memory usage.
wunder On Oct 7, 2011, at 8:48 AM, Tristan Roddis wrote: > We have a Solr server running on 64-bit Windows 2008, and under the default > Tomcat settings it seems to be using a small fraction of the available memory > (fluctuating between 100Mb and 300Mb: see trace from VisualVM at > http://imgur.com/4Om2El&tqLKW <http://imgur.com/4Om2El&tqLKW> ) > > I was advised that, to increase performance, we should increase the amount of > memory allocated to Tomcat so that Solr could use this to cache query results > and so reduce CPU usage and disk I/O. So, I set both the min and max RAM > allocation for Tomcat to 10Gb, which is well within the amount allocated to > the server (16Gb). I tried this on another machine, set a simulated load of > lots of concurrent users running on our application, and the VisualVM results > can be seen at http://imgur.com/4Om2E&tqLKWl <http://imgur.com/4Om2E&tqLKWl> > > These results were very different: in the first half of the graph, when the > system was under load, the amount of allocated heap size was fixed at 10Gb, > which I would expect, but the amount of used heap climbed gradually to around > 3Gb, but then shot right down again to something close to zero every minute > or so, presumably due to the GC kicking in, giving the sawtooth pattern you > can see in the screenshot above. > > My question is: is this normal and expected? I would have thought that the > amount of used heap would climb to somewhere much nearer the maximum > available of 10Gb, rather than peaking at a mere 3Gb. And also that any > garbage collection would only deallocate part of the memory rather than > knocking it right back to zero. > > Essentially, why isn't Solr using more of the memory assigned, and using it > constantly rather than continually clearing the cache? > > Thanks, > > -Tristan.