Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8253173: Print heap before and after GC lacks a newline #187

Closed

Conversation

stefank
Copy link
Member

@stefank stefank commented Sep 15, 2020

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.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8253173: Print heap before and after GC lacks a newline

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/187/head:pull/187
$ git checkout pull/187

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 15, 2020

👋 Welcome back stefank! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 15, 2020

@stefank The following label will be automatically applied to this pull request: hotspot.

When this pull request is ready to be reviewed, an RFR email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label (add|remove) "label" command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Sep 15, 2020
@stefank
Copy link
Member Author

stefank commented Sep 15, 2020

/label add hotspot-gc

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Sep 15, 2020
@openjdk
Copy link

openjdk bot commented Sep 15, 2020

@stefank
The hotspot-gc label was successfully added.

@stefank
Copy link
Member Author

stefank commented Sep 15, 2020

/label remove hotspot

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Sep 15, 2020
@openjdk
Copy link

openjdk bot commented Sep 15, 2020

@stefank
The hotspot label was successfully removed.

@stefank stefank marked this pull request as ready for review September 15, 2020 15:13
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 15, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 15, 2020

Webrevs

@openjdk
Copy link

openjdk bot commented Sep 15, 2020

@stefank This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8253173: Print heap before and after GC lacks a newline

Reviewed-by: tschatzl, pliden, rkennke, sjohanss
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 16 commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate f509eb069da3a482c1d4e58d959c79f8cb729fdd.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 15, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 15, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi,

On 15.09.20 17:17, Stefan Karlsson wrote:

When GC logging was converted to Unified Logging a newline went missing.

[...]

lgtm.

Thomas

Copy link
Contributor

@pliden pliden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@rkennke rkennke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@stefank
Copy link
Member Author

stefank commented Sep 16, 2020

/integrate

@openjdk openjdk bot closed this Sep 16, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 16, 2020
@openjdk
Copy link

openjdk bot commented Sep 16, 2020

@stefank Since your change was applied there have been 16 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 33f8e70.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@stefank stefank deleted the 8253173_print_heap_at_gc_newline branch September 28, 2020 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants