Re: RFR: 8266936: Add a finalization JFR event [v4]

2021-07-28 Thread Brent Christian
On Tue, 27 Jul 2021 15:14:29 GMT, Markus Grönlund  wrote:

>> Greetings,
>> 
>> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
>> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
>> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. 
>> 
>> We also like to assist users in replacing and mitigating uses in non-JDK 
>> code.
>> 
>> Hence, this changeset adds a periodic JFR event to help identify which 
>> classes are overriding Object.finalize().
>> 
>> Thanks
>> Markus
>
> Markus Grönlund has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   remove build directive

Hi, Bernd

The JFR event can complement static bytecode analysis, reporting which classes 
with finalizers actually get loaded at runtime. 

I agree that it would be useful to add a count for finalizers that get run, 
either as part of this PR, or as a follow-up.  I would hesitate to add timing, 
though.  It's important to keep the overhead of this event low, and finalize() 
methods should already show up in current profilers.

Thanks,
-Brent

> _Mailing list message from [Bernd Eckenfels](mailto:e...@zusammenkunft.net) 
> on [core-libs-dev](mailto:core-libs-...@mail.openjdk.java.net):_
> 
> Hello,
> 
> I know I am a bit late, but just wanted to mention, that since finding 
> finalizers with Bytecode analysis is doable (and probably easier to deal with 
> such scan reports), I don?t see much value in a JFR event, especially 
> considering it even has native code executed. (Not so sure about dynamically 
> loaded classes, would the event content help to identify sources?)
> 
> Having said that, this event would be more useful from a runtime perspective 
> if It would actually record execution counts and time per class. Then one can 
> concentrate on the worst offenders, first and even use it for runtime 
> monitoring. Is there already a finalizer profiler?
> 
> Gruss
> Bernd

-

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


Re: RFR: 8266936: Add a finalization JFR event [v4]

2021-07-27 Thread Bernd Eckenfels
Hello,

I know I am a bit late, but just wanted to mention, that since finding 
finalizers with Bytecode analysis is doable (and probably easier to deal with 
such scan reports), I don’t see much value in a JFR event, especially 
considering it even has native code executed. (Not so sure about dynamically 
loaded classes, would the event content help to identify sources?)

Having said that, this event would be more useful from a runtime perspective if 
It would actually record execution counts and time per class. Then one can 
concentrate on the worst offenders, first and even use it for runtime 
monitoring. Is there already a finalizer profiler?

Gruss
Bernd
--
http://bernd.eckenfels.net

Von: core-libs-dev  im Auftrag von Markus 
Grönlund 
Gesendet: Tuesday, July 27, 2021 5:14:29 PM
An: core-libs-dev@openjdk.java.net ; 
hotspot-jfr-...@openjdk.java.net 
Betreff: Re: RFR: 8266936: Add a finalization JFR event [v4]

> Greetings,
>
> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information.
>
> We also like to assist users in replacing and mitigating uses in non-JDK code.
>
> Hence, this changeset adds a periodic JFR event to help identify which 
> classes are overriding Object.finalize().
>
> Thanks
> Markus

Markus Grönlund has updated the pull request incrementally with one additional 
commit since the last revision:

  remove build directive

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4731/files
  - new: https://git.openjdk.java.net/jdk/pull/4731/files/58fc3f0a..44988036

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4731=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4731=02-03

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4731.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4731/head:pull/4731

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


Re: RFR: 8266936: Add a finalization JFR event [v4]

2021-07-27 Thread Markus Grönlund
> Greetings,
> 
> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. 
> 
> We also like to assist users in replacing and mitigating uses in non-JDK code.
> 
> Hence, this changeset adds a periodic JFR event to help identify which 
> classes are overriding Object.finalize().
> 
> Thanks
> Markus

Markus Grönlund has updated the pull request incrementally with one additional 
commit since the last revision:

  remove build directive

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4731/files
  - new: https://git.openjdk.java.net/jdk/pull/4731/files/58fc3f0a..44988036

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4731=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4731=02-03

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4731.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4731/head:pull/4731

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