Integrated: 8269685: Optimize HeapHprofBinWriter implementation

2021-09-27 Thread Lin Zang
On Fri, 2 Jul 2021 12:05:35 GMT, Lin Zang wrote: > This PR rewrite the implementation of the HeapHprofBinWriter, which could > simplify the logic of current implementation. > please see detail description at > https://bugs.openjdk.java.net/browse/JDK-8269685. This pull request has now been

RFR: 8274398: Suppress more warnings on non-serializable non-transient instance fields in management libs

2021-09-27 Thread Joe Darcy
Follow-up change to JDK-8232442, augmentations to javac's Xlint:serial checking are out for review (#5709) and various management libraries would need some changes to pass under the expanded checks. The changes are to suppress warnings where non-transient fields in serializable types are not

Re: RFR: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management

2021-09-27 Thread Chris Plummer
On Sat, 25 Sep 2021 10:51:12 GMT, Andrey Turbanov wrote: > There are a few places in code, where manual `for` loop is used with Iterator > to iterate over Collection. > Instead of manual `for` cycles, it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to

Re: RFR: 8274261: Use enhanced-for instead of plain 'for' in jdk.jcmd

2021-09-27 Thread Chris Plummer
On Fri, 24 Sep 2021 07:30:02 GMT, Andrey Turbanov wrote: > There are few places in code where manual `for` loop is used with Iterator to > iterate over Collection or Array. > Instead of manual `for` cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code

Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat

2021-09-27 Thread Chris Plummer
On Mon, 20 Sep 2021 08:15:13 GMT, Andrey Turbanov wrote: > There are few places in code where manual `for` loop is used with Iterator to > iterate over Collection or Array. > Instead of manual `for` cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code

RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat

2021-09-27 Thread Andrey Turbanov
There are few places in code where manual `for` loop is used with Iterator to iterate over Collection or Array. Instead of manual `for` cycles it's preferred to use enhanced-for cycle instead: it's less verbose, makes code easier to read and it's less error-prone. It doesn't have any performance

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

2021-09-27 Thread Mandy Chung
On Sat, 25 Sep 2021 14:22:28 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

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v4]

2021-09-27 Thread Lin Zang
On Mon, 27 Sep 2021 13:06:57 GMT, Per Liden wrote: >> Lin Zang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> remove redundant empty line > > src/hotspot/share/services/heapDumper.cpp line 1601: > >> 1599: void

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v5]

2021-09-27 Thread Lin Zang
> The root cause for crash in ZGC is that the JNIHandles are processed before > object iteration. And ZGC would update the JNIHandles at object iteration > with read barrier. So the crash is cause by accessing the invalid address > which can be dummy info after zgc, and hence crash. > > The

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v4]

2021-09-27 Thread Per Liden
On Mon, 27 Sep 2021 12:02:53 GMT, Lin Zang wrote: >> The root cause for crash in ZGC is that the JNIHandles are processed before >> object iteration. And ZGC would update the JNIHandles at object iteration >> with read barrier. So the crash is cause by accessing the invalid address >> which

Re: RFR: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields

2021-09-27 Thread Erik Joelsson
On Mon, 27 Sep 2021 01:00:18 GMT, Joe Darcy wrote: > This is an initial PR for expanded lint warnings done under two bugs: > > 8202056: Expand serial warning to check for bad overloads of serial-related > methods and ineffectual fields > 8160675: Issue lint warning for non-serializable

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v4]

2021-09-27 Thread Lin Zang
> The root cause for crash in ZGC is that the JNIHandles are processed before > object iteration. And ZGC would update the JNIHandles at object iteration > with read barrier. So the crash is cause by accessing the invalid address > which can be dummy info after zgc, and hence crash. > > The

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v3]

2021-09-27 Thread Lin Zang
> The root cause for crash in ZGC is that the JNIHandles are processed before > object iteration. And ZGC would update the JNIHandles at object iteration > with read barrier. So the crash is cause by accessing the invalid address > which can be dummy info after zgc, and hence crash. > > The

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v2]

2021-09-27 Thread Lin Zang
On Mon, 27 Sep 2021 09:39:59 GMT, Per Liden wrote: > > The root cause for crash in ZGC is that the JNIHandles are processed before > > object iteration. And ZGC would update the JNIHandles at object iteration > > with read barrier. So the crash is cause by accessing the invalid address > >

Re: RFR: 8274196: Crashes in VM_HeapDumper::work after JDK-8252842 [v2]

2021-09-27 Thread Per Liden
On Sun, 26 Sep 2021 08:02:33 GMT, Lin Zang wrote: >> The root cause for crash in ZGC is that the JNIHandles are processed before >> object iteration. And ZGC would update the JNIHandles at object iteration >> with read barrier. So the crash is cause by accessing the invalid address >> which

RFR: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields

2021-09-27 Thread Joe Darcy
This is an initial PR for expanded lint warnings done under two bugs: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields 8160675: Issue lint warning for non-serializable non-transient instance fields in serializable type to get feedback

Re: RFR: 8274261: Use enhanced-for instead of plain 'for' in jdk.jcmd

2021-09-27 Thread Serguei Spitsyn
On Fri, 24 Sep 2021 09:01:28 GMT, Andrey Turbanov wrote: >> src/jdk.jcmd/share/classes/sun/tools/jstat/OptionFormat.java line 81: >> >>> 79: >>> 80: for (Iterator i = children.iterator(); >>> i.hasNext(); /* empty */) { >>> 81: OptionFormat o = i.next(); >> >> Why did