JDK-8078703 : Ensure that GC's use of processor count is correct
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-04-27
  • Updated: 2019-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The GC uses the processor count to calculate default values for ParallelGCThreads and ConcGCThreads, as well as in calculating adaptive values in AdaptiveSizePolicy::calc_active_workers().

Issues to consider:
- Actual vs available CPUs running on a virtualized machine. This case is trivial - OS only reports CPUs available to virtualized machine. (Although HotSpot can see unusual configs, like 3 CPU machines).
- Actual vs available CPUs running on a container (Solaris Zone). Solaris reports total CPUs , not available CPUs?
- Actual vs available CPUs running on under tasksets. Linux reports total CPUs , not available CPUs?
- Online processor count can change during execution. On some embedded system, it may change as cores are put to sleep? If so, should we limit GC to the awake CPUs? I think not - it's time to wake them up!

Runtime APIs currently available:
os::processor_count()
os::active_processor_count()

So the goal is to:
1) Determine the maximum number of processors GC will ever see at startup so it can size some data structures.
2) Determine the current number of processors GC should consider using in AdaptiveSizePolicy calculations.
Comments
Sounds good to me...
21-07-2016

JDK-8161993 fixes the crash found. This CR is however much more generic than just fixing this crash, so I kept it open. However it should probably be changed to an enhancement.
21-07-2016

ILW = Medium (ergonomic decisions may be suboptimal), Medium (some hardware configurations), Low (use command line flags to override) = P4
29-04-2015