JDK-8027918 : Investigate increasing large object size threshold for G1
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25,8
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2013-11-06
  • Updated: 2016-12-15
  • Resolved: 2014-03-07
Related Reports
Relates :  
Relates :  
Currently, in G1 large objects are objects that cover half of a region. This is a problem in tight heaps with many large objects.

This is not optimal for the following reasons:
- lots of waste, up to 50% of region size
- programmers tend to size arrays in power of two chunks (and the default strategy when increasing buffer sizes is by doubling it), which results in many (array) objects that are just beyond this threshold
- G1 does not do a lot to keep large objects under control regarding placement, leading to fragmentation
- currently the only option to decrease the number of large objects in the heap is to increase the heap region size. In smaller heaps this is not a good solution, as this decreases the number of regions, limiting the flexibility of the G1 collector. Also this method puts the burden on the copying collector as it needs to copy more object data.

Investigate the effect of slightly increasing this threshold, and making it available using an experimental option.

Investigate further ideas in that direction, e.g. automatic threshold adapation, and/or making this setting dynamically adjustable.
Linked potential alternatives.

Stopping investigation into this. Changing the large object size threshold has too many side effects, and there are better alternatives available to lessen its impact. Reopen if needed.

Really bad side effects have been observed, mostly due to much more fragmentation in the allocators.

Possibly currently the maximum TLAB size is bound to exactly that size. Investigate any side effects in that area.