I don’t think having the initial heap larger than the max heap is a legal configuration. I have no idea what that would do.
Modern GCs have a separate area for short-lived allocations. When that fills up, a minor GC happens. As allocations survive several minor GCs, they are moved to the long-lived space, which is managed by major GCs. This is called a generational collector. In Solr, nearly all allocations are for a single request, so those are garbage after the response is sent. Most of the action will be in the new allocation (short-lived) space. Cache allocations get moved to the long-lived space. wunder Walter Underwood wun...@wunderwood.org http://observer.wunderwood.org/ (my blog) > On Oct 3, 2019, at 10:11 AM, ndra <publicmlu...@gmail.com> wrote: > >> When the heap is out of free space that >> can be recovered with minor GC, the JVM will increase the size if possible. >> Once it is at max, it will do a major GC. > > Thanks Walter, > > One more quick question about the above, so if the initial HEAP was larger > (or equal to the max as you suggested earlier) will the GCs minor GCs be > less frequent because the HEAP still has available space? > > Unfortunately the system was rebooted by a infrastructure person prior to > looking at `/admin/system/info` endpoint to look at the stats. Is there > another way get those statistics (there is no JVM monitoring in place from > our INF team so I am starting this all from scratch right now. > > Nick > > > On Thu, Oct 3, 2019 at 9:44 AM Walter Underwood <wun...@wunderwood.org> > wrote: > >>> On Oct 3, 2019, at 9:31 AM, ndra <publicmlu...@gmail.com> wrote: >>> >>> I was under the impression that by allocating a smaller initial HEAP I >>> could avoid having a larger GCs but if I am understanding what you all >> are >>> suggesting, the smaller initial HEAP is requiring more full GCs to >> maintian >>> a HEAP closer to 512MB. Is that correct? >> >> I don’t think either of those are true. When the heap is out of free space >> that >> can be recovered with minor GC, the JVM will increase the size if possible. >> Once it is at max, it will do a major GC. >> >> We use these settings in solr.in.sh: >> >> SOLR_HEAP=8g >> # Use G1 GC -- wunder 2017-01-23 >> # Settings from https://wiki.apache.org/solr/ShawnHeisey >> GC_TUNE=" \ >> -XX:+UseG1GC \ >> -XX:+ParallelRefProcEnabled \ >> -XX:G1HeapRegionSize=8m \ >> -XX:MaxGCPauseMillis=200 \ >> -XX:+UseLargePages \ >> -XX:+AggressiveOpts \ >> " >> wunder >> Walter Underwood >> wun...@wunderwood.org >> http://observer.wunderwood.org/ (my blog) >> >>