Introduce 'light' liveheap tracking for GC generations#93
Merged
Conversation
Contributor
|
🔧 Report generated by pr-comment-scanbuild Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
3a6bcc7 to
14b1bf0
Compare
richardstartin
approved these changes
May 9, 2024
| event._size = size; | ||
| event._weight = (float)((size == 0 || _interval == 0) ? 1 : 1 / (1 - exp(-size / (double)_interval))); | ||
|
|
||
| frames = new jvmtiFrameInfo[_max_stack_depth]; |
Contributor
There was a problem hiding this comment.
Can this use a linear allocator instead to avoid fragmentation?
Collaborator
Author
There was a problem hiding this comment.
Linear allocator requires a clearly defined lifecycle. This is, unfortunately, not the case here.
I could try something like _calltrace_buffer but that would require locking. I did a quick check whether removing this allocation would help with the internal fragmentation (by having only one pre-allocated array and single lock, so reducing parallelism to 1) but the RSS growth I can observe is unaffected :(
06315aa to
0e378c1
Compare
0e378c1 to
b858193
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
This change introduces a lightweight mode of the liveness tracker which is not collecting stacktraces and is tracking only the allocated type and the instance age.
Motivation:
For the Java memory leak page it is beneficial to be able to use the GC generations metric without the threat of crashing the app due to JVMTI jmethodID issue when symbolizing the stacktraces.
This mode is not enabled by default and needs to be turned on by supplying
generations=trueargument to the agent.How to test the change?:
A new sanity test is added which is making sure setting the profiler argument
generations=truewill indeed turn on the liveness tracker.For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!