RFR: JDK-8280002: jmap -histo may leak stream

2022-01-14 Thread Thomas Stuefe
Very trivial fix to a handle/memory leak. JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd GC.class_histogram`. When called with an explicit file and an invalid argument for number of threads, it leaks the file (bit of memory and a handle). Reproduce with: `jmap -hist

Re: RFR: 8279918: Fix various doc typos [v2]

2022-01-14 Thread Jan Lahoda
On Thu, 13 Jan 2022 14:01:04 GMT, Pavel Rappo wrote: >> - Most of the typos are of a trivial kind: missing whitespace. >> - If any of the typos should be fixed in the upstream projects instead, >> please say so; I will drop those typos from the patch. >> - As I understand it, ` ` in ImageInputSt

Re: RFR: 8279918: Fix various doc typos [v2]

2022-01-14 Thread Alexander Zvegintsev
On Thu, 13 Jan 2022 14:01:04 GMT, Pavel Rappo wrote: >> - Most of the typos are of a trivial kind: missing whitespace. >> - If any of the typos should be fixed in the upstream projects instead, >> please say so; I will drop those typos from the patch. >> - As I understand it, ` ` in ImageInputSt

RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Andrey Turbanov
`Properties.load` uses `java.util.Properties.LineReader`. LineReader already buffers input stream. Hence wrapping InputStream in BufferedInputStream is redundant. - Commit messages: - [PATCH] Remove double buffering of InputStream for Properties.load - [PATCH] Remove double buffer

Re: RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Sergey Bylokhov
On Mon, 10 Jan 2022 20:46:36 GMT, Andrey Turbanov wrote: > `Properties.load` uses `java.util.Properties.LineReader`. LineReader already > buffers input stream. Hence wrapping InputStream in BufferedInputStream is > redundant. The code change looks fine, but can you please check the actual perf

Re: RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Andrey Turbanov
On Mon, 10 Jan 2022 20:46:36 GMT, Andrey Turbanov wrote: > `Properties.load` uses `java.util.Properties.LineReader`. LineReader already > buffers input stream. Hence wrapping InputStream in BufferedInputStream is > redundant. Checked. `BufferedInputStream` add a bit of overhead. Benchmark @B

Re: RFR: 8279918: Fix various doc typos [v2]

2022-01-14 Thread Erik Gahlin
On Thu, 13 Jan 2022 14:01:04 GMT, Pavel Rappo wrote: >> - Most of the typos are of a trivial kind: missing whitespace. >> - If any of the typos should be fixed in the upstream projects instead, >> please say so; I will drop those typos from the patch. >> - As I understand it, ` ` in ImageInputSt

Re: RFR: JDK-8280002: jmap -histo may leak stream

2022-01-14 Thread Aleksey Shipilev
On Fri, 14 Jan 2022 10:04:53 GMT, Thomas Stuefe wrote: > Very trivial fix to a handle/memory leak. > > JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd > GC.class_histogram`. When called with an explicit file and an invalid > argument for number of threads, it leaks t

Re: RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Alex Menkov
On Mon, 10 Jan 2022 20:46:36 GMT, Andrey Turbanov wrote: > `Properties.load` uses `java.util.Properties.LineReader`. LineReader already > buffers input stream. Hence wrapping InputStream in BufferedInputStream is > redundant. Marked as reviewed by amenkov (Reviewer). - PR: https:

Re: RFR: JDK-8280002: jmap -histo may leak stream

2022-01-14 Thread Thomas Stuefe
On Fri, 14 Jan 2022 12:52:11 GMT, Aleksey Shipilev wrote: > This is not as trivial, AFAICS. Note that the existing code `delete fs` after > checking `if (os != NULL && os != out)`. Does it mean this patch can > effectively `delete out`? Thanks for looking at this. No, it is safe. `fs` is a te

Re: RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Daniel Fuchs
On Mon, 10 Jan 2022 20:46:36 GMT, Andrey Turbanov wrote: > `Properties.load` uses `java.util.Properties.LineReader`. LineReader already > buffers input stream. Hence wrapping InputStream in BufferedInputStream is > redundant. Changes to `java.util.logging` look fine. - PR: https:

Re: RFR: 8279918: Fix various doc typos [v2]

2022-01-14 Thread Jonathan Gibbons
On Thu, 13 Jan 2022 14:01:04 GMT, Pavel Rappo wrote: >> - Most of the typos are of a trivial kind: missing whitespace. >> - If any of the typos should be fixed in the upstream projects instead, >> please say so; I will drop those typos from the patch. >> - As I understand it, ` ` in ImageInputSt

Re: RFR: JDK-8280002: jmap -histo may leak stream

2022-01-14 Thread Aleksey Shipilev
On Fri, 14 Jan 2022 10:04:53 GMT, Thomas Stuefe wrote: > Very trivial fix to a handle/memory leak. > > JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd > GC.class_histogram`. When called with an explicit file and an invalid > argument for number of threads, it leaks t

Integrated: 8279918: Fix various doc typos

2022-01-14 Thread Pavel Rappo
On Thu, 13 Jan 2022 10:30:07 GMT, Pavel Rappo wrote: > - Most of the typos are of a trivial kind: missing whitespace. > - If any of the typos should be fixed in the upstream projects instead, > please say so; I will drop those typos from the patch. > - As I understand it, ` ` in ImageInputStream

Re: RFR: JDK-8280002: jmap -histo may leak stream [v2]

2022-01-14 Thread Thomas Stuefe
> Very trivial fix to a handle/memory leak. > > JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd > GC.class_histogram`. When called with an explicit file and an invalid > argument for number of threads, it leaks the file (bit of memory and a > handle). > > Reproduce w

Re: RFR: JDK-8280002: jmap -histo may leak stream [v2]

2022-01-14 Thread Thomas Stuefe
On Fri, 14 Jan 2022 16:07:23 GMT, Aleksey Shipilev wrote: > Okay then! Thanks, Alexey! After your concerns I consider this to be not trivial enough, so I wait for a second reviewer. - PR: https://git.openjdk.java.net/jdk/pull/7078

[jdk18] Integrated: 8280034: ProblemList jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64

2022-01-14 Thread Daniel D . Daugherty
A trivial fix to ProblemList jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64. - Commit messages: - 8280034: ProblemList jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64 Changes: https://git.openjdk.java.net/jdk18/pull/102/files Webrev: https:/

[jdk18] Integrated: 8280034: ProblemList jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64

2022-01-14 Thread Daniel D . Daugherty
On Fri, 14 Jan 2022 17:41:20 GMT, Daniel D. Daugherty wrote: > A trivial fix to ProblemList > jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64. This pull request has now been integrated. Changeset: 09d61b61 Author:Daniel D. Daugherty URL: https://git.openjdk.java

Re: [jdk18] Integrated: 8280034: ProblemList jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64

2022-01-14 Thread Calvin Cheung
On Fri, 14 Jan 2022 17:41:20 GMT, Daniel D. Daugherty wrote: > A trivial fix to ProblemList > jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64. LGTM. - Marked as reviewed by ccheung (Reviewer). PR: https://git.openjdk.java.net/jdk18/pull/102

Re: [jdk18] Integrated: 8280034: ProblemList jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64

2022-01-14 Thread Daniel D . Daugherty
On Fri, 14 Jan 2022 17:46:12 GMT, Calvin Cheung wrote: >> A trivial fix to ProblemList >> jdk/jfr/api/consumer/recordingstream/TestOnEvent.java on linux-x64. > > LGTM. @calvinccheung - Thanks for the fast review! - PR: https://git.openjdk.java.net/jdk18/pull/102

Re: RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Serguei Spitsyn
On Mon, 10 Jan 2022 20:46:36 GMT, Andrey Turbanov wrote: > `Properties.load` uses `java.util.Properties.LineReader`. LineReader already > buffers input stream. Hence wrapping InputStream in BufferedInputStream is > redundant. Marked as reviewed by sspitsyn (Reviewer). - PR: https

RFR: 8280035: Use Class.isInstance instead of Class.isAssignableFrom where applicable

2022-01-14 Thread Andrey Turbanov
Method `Class.isAssignableFrom` is often used in form of: if (clazz.isAssignableFrom(obj.getClass())) { Such condition could be simplified to more shorter and performarnt code if (clazz.isInstance(obj)) { Replacement is equivalent if it's known that `obj != null`. In JDK codebase the

Re: RFR: 8280035: Use Class.isInstance instead of Class.isAssignableFrom where applicable

2022-01-14 Thread Andrey Turbanov
On Thu, 13 Jan 2022 08:25:22 GMT, Andrey Turbanov wrote: > Method `Class.isAssignableFrom` is often used in form of: > > if (clazz.isAssignableFrom(obj.getClass())) { > Such condition could be simplified to more shorter and performarnt code > > if (clazz.isInstance(obj)) { > > Repl

Re: RFR: JDK-8280002: jmap -histo may leak stream [v2]

2022-01-14 Thread Serguei Spitsyn
On Fri, 14 Jan 2022 16:25:09 GMT, Thomas Stuefe wrote: >> Very trivial fix to a handle/memory leak. >> >> JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd >> GC.class_histogram`. When called with an explicit file and an invalid >> argument for number of threads, it le

Re: RFR: JDK-8280002: jmap -histo may leak stream

2022-01-14 Thread Thomas Stuefe
On Fri, 14 Jan 2022 12:52:11 GMT, Aleksey Shipilev wrote: >> Very trivial fix to a handle/memory leak. >> >> JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd >> GC.class_histogram`. When called with an explicit file and an invalid >> argument for number of threads, it

Integrated: JDK-8280002: jmap -histo may leak stream

2022-01-14 Thread Thomas Stuefe
On Fri, 14 Jan 2022 10:04:53 GMT, Thomas Stuefe wrote: > Very trivial fix to a handle/memory leak. > > JDK-8215624 added parallel heap iteration to both `jmap -histo` and `jcmd > GC.class_histogram`. When called with an explicit file and an invalid > argument for number of threads, it leaks t

Re: RFR: 8280010: Remove double buffering of InputStream for Properties.load

2022-01-14 Thread Sergey Bylokhov
On Mon, 10 Jan 2022 20:46:36 GMT, Andrey Turbanov wrote: > `Properties.load` uses `java.util.Properties.LineReader`. LineReader already > buffers input stream. Hence wrapping InputStream in BufferedInputStream is > redundant. Marked as reviewed by serb (Reviewer). - PR: https://g