United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7088680 G1: Cleanup in the G1CollectorPolicy class
JDK-7088680 : G1: Cleanup in the G1CollectorPolicy class

Details
Type:
Enhancement
Submit Date:
2011-09-09
Status:
Closed
Updated Date:
2012-01-23
Project Name:
JDK
Resolved Date:
2012-01-23
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs22
Fixed Versions:
hs23 (b03)

Related Reports
Backport:

Sub Tasks

Description
There is some cleanup that can be done in the G1CollectorPolicy class.

- Fields _n_marks and _n_marks_since_last_pause seem to be updated but never used and can be safely removed.
- The work done in record_concurrent_mark_cleanup_end() is split into record_concurrent_mark_cleanup_end_work1() and record_concurrent_mark_cleanup_end_workd2() and those two methods are also re-used in G1CollectorPolicy_BestRegionsFirst::record_concurrent_mark_cleanup_end(). It'd be nice to somehow unify them.
- In fact, we should probably fold the functionality from the G1CollectorPolicy_BestRegionsFirst class into the G1CollectorPolicy class and get rid of the former. I don't think we'll be needing this separation in the short term.

                                    

Comments
PUBLIC COMMENTS

There are also some more fields that are maintained but apparently not used:

_n_pauses_at_mark_end
_num_markings
_mark_thread_startup_sec

as well as the following method:

note_start_of_mark_thread() (it was just setting _mark_thread_startup_sec)
note_change_in_marked_bytes() (it is a nop)
default_init_heap_size() (never called)

I'll remove those too.
                                     
2011-09-26
PUBLIC COMMENTS

Regarding the G1CollectorPolicy_BestRegionsFirst class, I just removed it and put all its functionality into G1CollectorPolicy. If we ever want to have separate policies for G1 we can rethink the way we do it. Currently, we only have one and the way the "general" vs. "specific" separation was done was somewhat arbitrary. At least in the short- to medium- term we're better off not having the separation.

As part of the G1CollectorPolicy_BestRegionsFirst class removal, I made all the protected members private given that G1CollectorPolicy has no subclasses any more. I also devirtualized a bunch of methods (a lot of record_*-type methods) which do not need to be virtual (and never needed to be in the first place).
                                     
2011-09-26
PUBLIC COMMENTS

This turned out to be not that much work. I'll target it to hs23 to get it out of the way.
                                     
2011-09-26
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/074f0252cc13
                                     
2011-10-14
EVALUATION

See main CR
                                     
2011-10-28



Hardware and Software, Engineered to Work Together