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.
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
feat(cli): A: Add ability to dump pprof data to logs ... #3454
feat(cli): A: Add ability to dump pprof data to logs ... #3454
Changes from 8 commits
e4f030e
4057f4e
9d8dbd8
df8f4da
60969e2
12be359
caef02e
07c811f
3447c4a
6ca75af
ad89ffc
de512f8
d6bc21f
7577f7f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
KopiaDebugFlagForceGc
be a "global" flag that applies to all profiles?or
Should
runtime.GC()
be only called once even if multiple profiles specify the flag?Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to ensure that GC was run immediately before any memory profiling. This will allow users to check for memory leaks. There's a chance that other operations in the loop will allocate additional memory that I did not want to show up on the profile.
I did not want to special case which profiles allowed GC because PPROF dumps can be added by users - and there's no determining which profiles will benefit from an immediate GC. I could not conceive a scenario where only one GC would be required to produce accurate results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking because it is not clear to me whether a GC is needed before dumping each profile, or what difference it makes. To be clear, I don't have a good answer.
When stopping and dumping the profiles, it seems that a possible sequence would be
GC
->dump profile 1
-> GC ->dump profile 2
->GC
->dump profile 3
In this case profile 2 would contain some information (allocations or side effects) coming from performing
dump profile 1
. Similarly, profile 3 would contain information coming from dumping profiles 1 and 2.An alternative sequence would be.
GC
->dump profile 1
,dump profile 2
->dump profile 3
Not sure if it would make a difference, or if it matters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway 🤷🏼♂️