Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8e3708d8
Commit
8e3708d8
authored
Nov 26, 2013
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18874: allow to call tracemalloc.Snapshot.statistics(cumulative=True)
with traceback_limit=1
parent
00773df9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
6 deletions
+1
-6
Doc/library/tracemalloc.rst
Doc/library/tracemalloc.rst
+1
-2
Lib/tracemalloc.py
Lib/tracemalloc.py
+0
-4
No files found.
Doc/library/tracemalloc.rst
View file @
8e3708d8
...
@@ -479,8 +479,7 @@ Snapshot
...
@@ -479,8 +479,7 @@ Snapshot
If *cumulative* is ``True``, cumulate size and count of memory blocks of
If *cumulative* is ``True``, cumulate size and count of memory blocks of
all frames of the traceback of a trace, not only the most recent frame.
all frames of the traceback of a trace, not only the most recent frame.
The cumulative mode can only be used with *group_by* equals to
The cumulative mode can only be used with *group_by* equals to
``'filename'`` and ``'lineno'`` and :attr:`traceback_limit` greater than
``'filename'`` and ``'lineno'``.
``1``.
The result is sorted from the biggest to the smallest by:
The result is sorted from the biggest to the smallest by:
:attr:`Statistic.size`, :attr:`Statistic.count` and then by
:attr:`Statistic.size`, :attr:`Statistic.count` and then by
...
...
Lib/tracemalloc.py
View file @
8e3708d8
...
@@ -380,10 +380,6 @@ class Snapshot:
...
@@ -380,10 +380,6 @@ class Snapshot:
if
cumulative
and
key_type
not
in
(
'lineno'
,
'filename'
):
if
cumulative
and
key_type
not
in
(
'lineno'
,
'filename'
):
raise
ValueError
(
"cumulative mode cannot by used "
raise
ValueError
(
"cumulative mode cannot by used "
"with key type %r"
%
key_type
)
"with key type %r"
%
key_type
)
if
cumulative
and
self
.
traceback_limit
<
2
:
raise
ValueError
(
"cumulative mode needs tracebacks with at least "
"2 frames, traceback limit is %s"
%
self
.
traceback_limit
)
stats
=
{}
stats
=
{}
tracebacks
=
{}
tracebacks
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment