On Tue, 2017-09-26 at 07:43 -0700, sasarun wrote: > Allocated heap size for young generation is about 8 gb and old > generation is about 24 gb. And gc analysis showed peak > size utlisation is really low compared to these values.
That does not come as a surprise. Your collections would normally be considered small, if not tiny, looking only at their size measured in bytes. Again, if you expect them to grow significantly (more than 10x), your allocation might make sense. If you do not expect such a growth in the near future, you will be better off with a much smaller heap: The peak heap utilization that you have logged (or twice that to err on the cautious side) seems a good starting point. And whatever you do, don't set Xmx to 32GB. Use <31GB or significantly more than 32GB: https://blog.codecentric.de/en/2014/02/35gb-heap-less-32gb-java-jvm-mem ory-oddities/ Are you indexing while you search? If so, you need to set auto-warm or state a few explicit warmup-queries. If not, your measuring will not be representative as it will be on first-searches, which are always slower than warmed-searches. - Toke Eskildsen, Royal Danish Library