Support add new -X option to dump heap and current stack automaticlly when MemoryError has been raised
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Durchsicht dieses Vorschlags und des zugehörigen Issues #60585 und vergleiche anschließend das angeforderte Verhalten mit der verknüpften Java-Option zur Fehlerbehebung. Lege vor der Implementierung die Befehlszeilenschnittstelle, die Semantik von Heap- und Stack-Dumps sowie das Verhalten bei MemoryError fest; als abgeschlossen gilt die Aufgabe, wenn ein akzeptiertes Design und Tests für die neue Option vorliegen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100