mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-135953: Reduce memory usage of stack collectors (#138875)
The stack collector base class keeps all frames until export() is called, which causes significant unnecessary memory usage. Instead, we can process the frames on the fly in the collect call by dispatching the aggregation logic to the subclass through the process_frames method. Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
This commit is contained in:
parent
efc08c5fbf
commit
3e06cfcaee
5 changed files with 292 additions and 174 deletions
|
|
@ -7,5 +7,6 @@
|
|||
from .collector import Collector
|
||||
from .pstats_collector import PstatsCollector
|
||||
from .stack_collector import CollapsedStackCollector
|
||||
from .string_table import StringTable
|
||||
|
||||
__all__ = ("Collector", "PstatsCollector", "CollapsedStackCollector")
|
||||
__all__ = ("Collector", "PstatsCollector", "CollapsedStackCollector", "StringTable")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue