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

Log warning when Major GC fails to recover significant memory #1235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wweiss-starburst
Copy link
Contributor

There are instances where processes spin in GC loops when Major GCs fail to recover enough memory. By providing a warning before this condition is reached, it should be possible to act on the warning by taking a JFR before the JVM completely runs out of memory.

@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch from c394d26 to 2852235 Compare August 2, 2024 18:50
stats/src/main/java/io/airlift/stats/JmxGcMonitor.java Outdated Show resolved Hide resolved
stats/src/main/java/io/airlift/stats/JmxGcMonitor.java Outdated Show resolved Hide resolved
stats/src/main/java/io/airlift/stats/JmxGcMonitor.java Outdated Show resolved Hide resolved
stats/src/main/java/io/airlift/stats/JmxGcMonitor.java Outdated Show resolved Hide resolved
stats/src/main/java/io/airlift/stats/JmxGcMonitor.java Outdated Show resolved Hide resolved
stats/src/main/java/io/airlift/stats/JmxGcMonitor.java Outdated Show resolved Hide resolved
@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch 2 times, most recently from 06ed441 to 1ccf811 Compare August 6, 2024 19:51
@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch 3 times, most recently from cead9c7 to 846685b Compare August 9, 2024 01:21
@wweiss-starburst
Copy link
Contributor Author

PR has been updated to support the Z collector. Note that when Generational is not enabled, the logging is noisy because it does not distinguish major and minor collections.

@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch 3 times, most recently from 7541724 to a3f079d Compare August 9, 2024 20:28
@electrum
Copy link
Member

MBean names for reference

G1:

G1 Young Generation
G1 Concurrent GC
G1 Old Generation

ZGC: -XX:+UseZGC

ZGC Cycles
ZGC Pauses

ZGC Generational: -XX:+UseZGC -XX:+ZGenerational

ZGC Minor Cycles
ZGC Minor Pauses
ZGC Major Cycles
ZGC Major Pauses

@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch from a3f079d to 8eec730 Compare August 20, 2024 08:33
@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch from 8eec730 to 8de9aed Compare August 29, 2024 16:13
@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch from 8de9aed to 88fe52c Compare September 26, 2024 14:39
There are instances where processes spin in GC loops when Major GCs fail
to recover enough memory. By providing a warning before this condition
is reached, it should be possible to act on the warning by taking a JFR
before the JVM completely runs out of memory.
@wweiss-starburst wweiss-starburst force-pushed the wweiss/warn-when-major-gcs-become-problematic branch from 88fe52c to 81d0982 Compare December 24, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants