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

8255848: -Xlog:gc+heap+exit shows "used 0K" #1051

Closed
wants to merge 1 commit into from

Conversation

kstefanj
Copy link
Contributor

@kstefanj kstefanj commented Nov 4, 2020

Please review this small change to improve the exit heap-log for G1.

Currently if all allocations fit into one region the exit log will faulty state that the usage is 0K:

$ java -Xlog:gc+heap+exit -Xshare:off -Xmx16g -version
[0.072s][info][gc,heap,exit] garbage-first heap total 1032192K, used 0K [0x00000003c0000000, 0x00000007c0000000)
[0.072s][info][gc,heap,exit] region size 8192K, 1 young (8192K), 0 survivors (0K)

This is cause by G1 using used_unlocked(), which doesn't take the current allocation region(s) into account. My proposed change is to check if the Heap_lock is taken and if so use used() instead of used_unlocked(). For the exit logging the lock will be held, but this log is printed using G1CollectedHeap::print_on() and we might want to allow calling this without requiring holding the heap lock.


Progress

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

Testing

Linux x64 Linux x86 Windows x64 macOS x64
Build ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 4, 2020

👋 Welcome back sjohanss! 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 openjdk bot added the rfr Pull request is ready for review label Nov 4, 2020
@openjdk
Copy link

openjdk bot commented Nov 4, 2020

@kstefanj The following label will be automatically applied to this pull request:

  • hotspot-gc

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 pull request command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Nov 4, 2020
@mlbridge
Copy link

mlbridge bot commented Nov 4, 2020

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

lgtm.

@openjdk
Copy link

openjdk bot commented Nov 4, 2020

@kstefanj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8255848: -Xlog:gc+heap+exit shows "used 0K"

Reviewed-by: tschatzl, ayang

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 27 new commits pushed to the master branch:

  • 7f4d873: 8255215: Unsupported 'valign' attribute for 'tr' tag used in j.s.t.h.HTMLDocument
  • 724217c: 8255893: Problemlist runtime/cds/appcds/jigsaw/NewModuleFinderTest.java
  • 6023f6b: 8188055: (ref) Add Reference::refersTo predicate
  • ab9192e: 8255681: print callstack in error case in runAWTLoopWithApp
  • c7a2c24: 8255797: ciReplay: improve documentation of replay file syntax in parser
  • a5d8a9c: 8255617: Zero: purge the remaining bytecode interpreter profiling support
  • 4b88119: 8253037: G1: Improve check for string dedup
  • 2668d23: 8255861: Also update jaotc.1 for JDK 16
  • 76fa974: 8255850: Hotspot recompiled on first incremental build
  • 622f72b: 8255853: Update all nroff manpages for JDK 16 release
  • ... and 17 more: https://git.openjdk.java.net/jdk/compare/1d0bd50624e3fe1c1ecbeac5311994e1e3f42b26...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ 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 Nov 4, 2020
@kstefanj
Copy link
Contributor Author

kstefanj commented Nov 5, 2020

/integrate

@openjdk openjdk bot closed this Nov 5, 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 Nov 5, 2020
@openjdk
Copy link

openjdk bot commented Nov 5, 2020

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

  • eb85b8d: 8255665: C2 should aggressively remove temporary hook nodes
  • 18bc95b: 8250625: Compiler implementation of Pattern Matching for instanceof (Final)
  • 60e4aca: 8255890: Zero: remove unused methods from BytecodeInterpreter
  • 397bae2: 8255860: Clean up CDS logging related to lambda
  • 97a81ce: 8253385: annotation processors remove varargs information from record components
  • 166c728: 8255858: Add debug agent support for storing thread names
  • a0ade22: 8255900: x86: Reduce impact when VerifyOops is disabled
  • 29db1dc: 8255886: Shenandoah: Resolve cset address truncation and register clash in interpreter LRB
  • 26e7ef7: 8252870: Finalize (remove "incubator" from) jpackage
  • 804bd72: 8255128: linux x86 build failure with libJNIPoint.c
  • ... and 34 more: https://git.openjdk.java.net/jdk/compare/1d0bd50624e3fe1c1ecbeac5311994e1e3f42b26...master

Your commit was automatically rebased without conflicts.

Pushed as commit 397972e.

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

openjdk-notifier bot referenced this pull request Nov 5, 2020
@kstefanj kstefanj deleted the 8255848-exit branch May 18, 2021 12:07
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.

3 participants