On Tue, 3 Nov 2020 21:14:04 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
>> src/hotspot/share/prims/jvmtiTagMap.cpp line 3018: >> >>> 3016: } >>> 3017: // Later GC code will relocate the oops, so defer rehashing >>> until then. >>> 3018: tag_map->_needs_rehashing = true; >> >> This is wrong for some collectors. I think all collectors ought to be >> calling set_needs_rehashing in appropriate places, and it can't be be >> correctly piggybacked on the num-dead callback. (See discussion above for >> that function.) >> >> For example, G1 remark pause does weak processing (including weak >> oopstorage) and will call the num-dead callback, but does not move objects, >> so does not require tagmap rehashing. >> >> (I think CMS oldgen remark may have been similar, for what that's worth.) > > Ok, so I'm going to need help to know where in all the different GCs to make > this call. This seemed simpler at the expense of maybe causing a rehash at > some points when it might not be necessary. For what GC is this wrong? I can see that it might yield more work than required, when performing a full GC, but not that it would do too little work. In other words, I can't see how it is wrong, as opposed to inaccurate. Littering GCs with JVMTI hooks so that we can optimize away an operation we do every young GC, from a full GC, does not really seem worth it IMO. ------------- PR: https://git.openjdk.java.net/jdk/pull/967