Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Alan Bateman
On Wed, 26 Jul 2023 06:17:13 GMT, Vyom Tewari wrote: > If i am reading code correctly then with the new implementation, until client > issue the next "FIS.read" he may or may not know if there was exception > pending in previous 'read' call ?. > I am not sure in case of partial read we have sup

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Vyom Tewari
On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with th

Re: RFR: 8312630: java/security should not create unmodifiable collections with redundant wrapping

2023-07-25 Thread Xue-Lei Andrew Fan
On Tue, 25 Jul 2023 06:27:25 GMT, John Jiang wrote: > Some java/security classes apply the below coding style, > > Set set = ...; > Set unmodifiableSet = Collections.unmodifiableSet(new HashSet<>(set)); > > It may be unnecessary to wrap that `set` with HashSet before creating > `unmodifiableSe

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Vyom Tewari
On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with th

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Vyom Tewari
On Tue, 25 Jul 2023 23:50:07 GMT, Brian Burkhalter wrote: >> Limit native memory allocation and move write loop from the native layer >> into Java. This change should make the OOME reported in the issue much less >> likely. > > Brian Burkhalter has updated the pull request incrementally with th

RFR: 8313087: DerValue::toString should output the values in byte array

2023-07-25 Thread John Jiang
DerValue::toString may be better to output the hex view of the byte array variable `buffer`. - Commit messages: - 8313087: DerValue::toString should output the values in byte array Changes: https://git.openjdk.org/jdk/pull/15029/files Webrev: https://webrevs.openjdk.org/?repo=jdk&

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Brian Burkhalter
On Tue, 25 Jul 2023 05:51:26 GMT, Alan Bateman wrote: >> It's based on micro-benchmarks. Having the loops in Java reduces throughput >> but allocating memory using `malloc(len)` also reduces throughput as `len` >> gets larger and this threshold appears to balance the two. > >> It's based on mic

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Brian Burkhalter
> Limit native memory allocation and move write loop from the native layer into > Java. This change should make the OOME reported in the issue much less likely. Brian Burkhalter has updated the pull request incrementally with three additional commits since the last revision: - 6478546: Decreas

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Brian Burkhalter
On Tue, 25 Jul 2023 02:05:52 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/java/io/FileOutputStream.java line 366: >> >>> 364: int n = writeBytes(b, off, len, append); >>> 365: if (n == -1) >>> 366: break; >> >> Checking if n is

Re: RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v2]

2023-07-25 Thread Brian Burkhalter
On Mon, 24 Jul 2023 13:04:56 GMT, Alan Bateman wrote: >> src/java.base/share/native/libjava/io_util.c line 99: >> >>> 97: return 0; >>> 98: } else if (len > BUF_SIZE) { >>> 99: if (len > MAX_MALLOC_SIZE) >> >> Hi Brian if I am reading code correctly then with the current cod

Integrated: JDK-8311592 ECKeySizeParameterSpec causes too many exceptions on third party providers

2023-07-25 Thread Anthony Scarpino
On Tue, 18 Jul 2023 03:58:50 GMT, Anthony Scarpino wrote: > Hi, > > This fix eliminates needless exceptions each time the EC key size is obtained > through AlgorithmParameters on third party providers. These providers throw > an InvalidParameterSpecException as `sun.security.util.KeyUtil.get

Integrated: JDK-8312512: sspi.cpp avoid some NULL checks related to free and delete

2023-07-25 Thread Matthias Baesken
On Mon, 24 Jul 2023 07:50:44 GMT, Matthias Baesken wrote: > sspi.cpp contains the gss_export_name function, where at the end some cleanup > is done by calling delete. However this should be done more careful, because > the function get_full_name which is called in gss_export_name might return