allow disabling automatic full collection when computing growth
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 840
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
I recently experienced a manifestation of https://bugs.python.org/issue39061 which I had worked around by running a full collection (`gc.collect()`) at regular intervals. I started using `objgraph` to try to find the source of the "leak" (the reference cycle) which moved and accumulated objects in the generation 2 collection which also made the issue disappear, just as my regular garbage collection was. I thus assumed that `objgraph` was calling `gc.collect()` and indeed it was.
I commented out the call to `gc.collect()` in `growth` which allowed me to identify the reference cycle which I could fix using weakrefs.
I would like to propose a new option to the `growth`/`show_growth` functions to disable the automatic full collection. Maybe running a generation 1 collection or none at all even if it means that there would be more false positive showing up in the growth report.
This is a proposition and I will gladly do the change if it sounds like it would be useful.
By the way, `objgraph` has helped me more than once at this point. Thank you very much.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by locating the growth and show_growth entry points and reading how they currently trigger a full garbage collection. Trace the option through both functions and check the existing tests around growth reporting. Done means callers can disable the automatic full collection without breaking the default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100