RFR: 8275775: VM.metaspace prints flag 'f' for classes that overrided finalize()

Yi Yang yyang at openjdk.java.net
Tue Oct 26 02:21:16 UTC 2021


On Mon, 25 Oct 2021 00:34:37 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Some customers want to observe which loaded classes have overridden the finalize() method. I found that VM.metaspace can output detailed classes. It seems feasible to add 'f' flag to it. With this patch, I found that ZipFileSystem left a finalize after applying this patch, which was obsolete 5 years ago, maybe we should remove it?
>
> src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp line 46:
> 
>> 44:   // Print a 's' for shared classes
>> 45:   _out->put(k->is_shared() ? 's' : ' ');
>> 46:   // Print 's' for classes that overrided finalize() method
> 
> s/'s'/'f'/
> 
> s/overrided/override/

Thanks for clarification. I skim through the code:

  if (!_has_empty_finalizer) {
    if (_has_finalizer ||
        (super != NULL && super->has_finalizer())) {
      ik->set_has_finalizer();
    }
  }

Yes, "has a non-trivial finalize() method" expresses more clear.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6075


More information about the hotspot-runtime-dev mailing list