proposal: scan and record memory partially
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
Research direction
Start by reviewing the markStub branch and its demo at test/testdata/stubaddr/main.go. Determine how the proposed stub pointer should be added to selected struct types and how goref should identify reachable objects from the supplied address. Done means the feature supports partial scanning of isolated memory regions, with coverage for the demonstrated use case and its memory-cost tradeoff considered.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
When the memory footprint is large, we may only consider some part of objects, which can reduce the size of generated profile.
Although pprof provides show_from and focus options to hide other parts of objects, there may be cases we need to consider two isolated parts of memory at the same time.
Describe the solution you'd like
Intrusively add a stub pointer field to the struct types of interest within the program under test. Then goref can trace objects reachable from struct objects which holds the stub address provided by goref.
Describe alternatives you've considered
Write goref profile parser and consider interested objects only. But it seems not convenient as this approach.
But stub field in the proposal causes more memory consumption for objects which contain the field.
Additional context
I've implemented the idea in markStub branch. It supports adding a stub pointer in objects of struct type. Then goref will only trace objects reachable from those objects that contain the stub address.
test/testdata/stubaddr/main.go is a demo program to show how markStub can be used to trace certain objects.
- Dominant language
- Go
- Stars
- 1k
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudwego/goref
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
gcmask typoPossibly taken @saschabuehrle claimed this 261 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 45/100
-
Record stack trace for root objects which are local variablesPossibly taken @Lslightly claimed this 162 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
eryajf/learning-weekly#260 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
OpenAI embedding client returns batch vectors in response order despite explicit input indicesPossibly taken @ningsiyuan1024 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day