RFR: 8073545 - Use shorter and more descriptive names for GC worker threads

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Wed Mar 4 13:52:29 UTC 2015

Hi David,

Thanks for fixing this!

A couple of questions:

-  set_name("G1 Concurrent Refinement Thread#%d", worker_id);
+  set_name("G1 ConRefine#%d", worker_id);

Is there any refinement threads that are not concurrent? If not, could we just 
call this "G1 Refine#%d" to simplify it slightly and remove an implementation 
detail that doesn't need to be exposed? This would also leave room for three 
digit numbers in case we have lots of these threads on some systems.

-  _parallel_workers = new FlexibleWorkGang("G1 Parallel Marking Threads",
+  _parallel_workers = new FlexibleWorkGang("G1 Markers",

Markers is cute, but could be misunderstood. Can we call it "G1 Mark Threads" 

-  set_name("G1 Main Concurrent Mark GC Thread");
+  set_name("G1 Main Marker");

Again, "Marker" could be misunderstood. I don't have a good replacement though.

-  set_name("GC task thread#%d (ParallelGC)", which);
+  set_name("ParGC Thread#%d", which);

I don't have a good suggestion for how to make this one character shorter, but 
currently there is only room for two digit numbers. Maybe just "GC Thread#%d". I 
don't think these threads will exist at the same time as any other GC threads 

-  set_name("Gang worker#%d (%s)", id, gang->name());
+  set_name("%s#%d", gang->name(), id);

Is there any limitation on the length of the name()? If it's too long the number 
won't show. Can we add an assert to make sure it isn't too long?


David Lindholm skrev den 4/3/15 13:48:
> Hi,
> Please review this small fix which changes the names of the GC threads to be
> shorter and more descriptive. There is a limit on 16 characters including the
> terminating null byte for this name, since pthread_set_name_np() is used. This
> change will make it easier to debug, as these names shows up in the debugger.
> Webrev: http://cr.openjdk.java.net/~brutisso/8073545/webrev.00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8073545
> Testing: Passed JPRT.
> Regards,
> David

More information about the hotspot-gc-dev mailing list