[11u] RFR: 8260030: Improve stringStream buffer handling

Thomas Stüfe thomas.stuefe at gmail.com
Tue May 11 16:28:10 UTC 2021


Thank you Martin!

On Tue, May 11, 2021 at 6:02 PM Doerr, Martin <martin.doerr at sap.com> wrote:

> Hi Thomas,
>
>
>
> looks good. Thanks for backporting.
>
>
>
> Best regards,
>
> Martin
>
>
>
>
>
> *Von: *hotspot-runtime-dev <hotspot-runtime-dev-retn at openjdk.java.net> im
> Auftrag von Thomas Stüfe <thomas.stuefe at gmail.com>
> *Datum: *Dienstag, 11. Mai 2021 um 07:42
> *An: *jdk-updates-dev <jdk-updates-dev at openjdk.java.net>
> *Cc: *Hotspot dev runtime <hotspot-runtime-dev at openjdk.java.net>
> *Betreff: *[11u] RFR: 8260030: Improve stringStream buffer handling
>
> Hi all,
>
> I would like to downport the following patch:
>
> https://bugs.openjdk.java.net/browse/JDK-8260030
> Original patch: https://github.com/openjdk/jdk/commit/d066f2b0.diff
> Original review: https://github.com/openjdk/jdk/pull/2160
>
> This patch greatly reduces the number of malloc/free calls done when
> printing small strings to stringStream: In debug, malloc calls from
> stringStream ~211000 -> 53000. In a release VM, they drop even further,
> ~85000 down to just about a 1000 calls. It does so by providing
> stringStream with a small, in-object array as a backing buffer for small
> streams, and only switches to C-Heap when this buffer is exhausted, which
> most of the time won't happen.
>
> This also provides code parity with upstream, making future fixes easier to
> downport.
>
> The patch does not apply cleanly, since 8238358 (JEP 371: Hidden Classes)
> changed stringStream::as_string(), adding the option to return the stream
> content in C-heap and not as resource area. The differences are limited to
> that function and superficial.
>
> The 11u patch:
>
> http://cr.openjdk.java.net/~stuefe/webrevs/backports/8260030-improve-stringStream-buffer-handling-11u
>
> The patch has been cooking in our internal systems for several weeks now.
>
> Thank you!
>
> Thomas
>


More information about the hotspot-runtime-dev mailing list