RFR: 8253173: Print heap before and after GC lacks a newline
When GC logging was converted to Unified Logging a newline went missing. - st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); vs + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); This gives lines like this: GC(29) Heap after GC invocations=30 (full 30): ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K Instead of: GC(29) Heap after GC invocations=30 (full 30): GC(29) ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K In our hs_err files we print this with a newline: st.print_cr("{Heap %s GC invocations=%u (full %u):", before ? "before" : "after", heap->total_collections(), heap->total_full_collections()); I propse that we add this missing newline. ------------- Commit messages: - Add print heap at GC newline and move the code Changes: https://git.openjdk.java.net/jdk/pull/187/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=187&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8253173 Stats: 39 lines in 3 files changed: 15 ins; 22 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/187.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/187/head:pull/187 PR: https://git.openjdk.java.net/jdk/pull/187
Hi, On 15.09.20 17:17, Stefan Karlsson wrote:
When GC logging was converted to Unified Logging a newline went missing.
[...]
lgtm. Thomas
On Tue, 15 Sep 2020 15:04:09 GMT, Stefan Karlsson <stefank@openjdk.org> wrote:
When GC logging was converted to Unified Logging a newline went missing.
- st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); vs + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); This gives lines like this: GC(29) Heap after GC invocations=30 (full 30): ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K Instead of: GC(29) Heap after GC invocations=30 (full 30): GC(29) ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K In our hs_err files we print this with a newline:
st.print_cr("{Heap %s GC invocations=%u (full %u):", before ? "before" : "after", heap->total_collections(), heap->total_full_collections()); I propse that we add this missing newline.
Marked as reviewed by tschatzl (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/187
On Tue, 15 Sep 2020 15:04:09 GMT, Stefan Karlsson <stefank@openjdk.org> wrote:
When GC logging was converted to Unified Logging a newline went missing.
- st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); vs + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); This gives lines like this: GC(29) Heap after GC invocations=30 (full 30): ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K Instead of: GC(29) Heap after GC invocations=30 (full 30): GC(29) ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K In our hs_err files we print this with a newline:
st.print_cr("{Heap %s GC invocations=%u (full %u):", before ? "before" : "after", heap->total_collections(), heap->total_full_collections()); I propse that we add this missing newline.
Looks good! ------------- Marked as reviewed by pliden (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/187
On Tue, 15 Sep 2020 15:04:09 GMT, Stefan Karlsson <stefank@openjdk.org> wrote:
When GC logging was converted to Unified Logging a newline went missing.
- st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); vs + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); This gives lines like this: GC(29) Heap after GC invocations=30 (full 30): ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K Instead of: GC(29) Heap after GC invocations=30 (full 30): GC(29) ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K In our hs_err files we print this with a newline:
st.print_cr("{Heap %s GC invocations=%u (full %u):", before ? "before" : "after", heap->total_collections(), heap->total_full_collections()); I propse that we add this missing newline.
Looks good to me. ------------- Marked as reviewed by rkennke (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/187
On Tue, 15 Sep 2020 15:04:09 GMT, Stefan Karlsson <stefank@openjdk.org> wrote:
When GC logging was converted to Unified Logging a newline went missing.
- st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); vs + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); This gives lines like this: GC(29) Heap after GC invocations=30 (full 30): ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K Instead of: GC(29) Heap after GC invocations=30 (full 30): GC(29) ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K In our hs_err files we print this with a newline:
st.print_cr("{Heap %s GC invocations=%u (full %u):", before ? "before" : "after", heap->total_collections(), heap->total_full_collections()); I propse that we add this missing newline.
Marked as reviewed by sjohanss (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/187
On Tue, 15 Sep 2020 15:04:09 GMT, Stefan Karlsson <stefank@openjdk.org> wrote:
When GC logging was converted to Unified Logging a newline went missing.
- st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); vs + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); This gives lines like this: GC(29) Heap after GC invocations=30 (full 30): ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K Instead of: GC(29) Heap after GC invocations=30 (full 30): GC(29) ZHeap used 20M, capacity 2014M, max capacity 30718M GC(29) Metaspace used 6779K, capacity 6857K, committed 7040K, reserved 1056768K GC(29) class space used 574K, capacity 620K, committed 640K, reserved 1048576K In our hs_err files we print this with a newline:
st.print_cr("{Heap %s GC invocations=%u (full %u):", before ? "before" : "after", heap->total_collections(), heap->total_full_collections()); I propse that we add this missing newline.
This pull request has now been integrated. Changeset: 33f8e702 Author: Stefan Karlsson <stefank@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/33f8e702 Stats: 39 lines in 3 files changed: 22 ins; 15 del; 2 mod 8253173: Print heap before and after GC lacks a newline Reviewed-by: tschatzl, pliden, rkennke, sjohanss ------------- PR: https://git.openjdk.java.net/jdk/pull/187
participants (6)
-
Per Lidén
-
Roman Kennke
-
Stefan Johansson
-
Stefan Karlsson
-
Thomas Schatzl
-
Thomas Schatzl