Support add new -X option to dump heap and current stack automaticlly when MemoryError has been raised
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
This idea may be similar to #60585
In the production environment, the memory leak is a common issue for all the developers. For now, we may have two kinds of way to debug it.
- Intrusive way, we need to modify our code, inject some code to monitor the object malloc, and publish/deploy it again. It will use a lot of time in non-python-code process.
- Process attach way, we may use the tools like
py-spyor otherptracebased way to attach to the process, and dump/analyze the all memory. It's useful but will be limited in the container. For most circumstance, we limit the privilege of the container which is means that the ptrace based way will be unuseable because of the security issue.
I think maybe we can introduce a new -x option to dump heap and current stack automaticlly when MemoryError has been raised just like the developer did in JVM
FYI https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Contributor 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.
Research direction
Start by reviewing this proposal and the related issue #60585, then compare the requested behavior with the linked Java troubleshooting option. Define the command-line interface, heap and stack dump semantics, and MemoryError behavior before implementation; done requires an accepted design and tests for the new option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100