Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Profiling Sync
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit f3f0790
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After running the sync test for RHEL 7,
I ran this script:
import linecache
import os
import tracemalloc
snapshots = []
traces = [t for t in os.listdir("/tmp") if t.startswith("tracemalloc-")]
traces = sorted(traces, key=lambda t: int(t.split(".")[-2].split("-")[-1]))
def display_top(snapshot, key_type='lineno'):
snapshot = snapshot.filter_traces((
tracemalloc.Filter(False, "<frozen importlib._bootstrap>"),
tracemalloc.Filter(False, "<unknown>"),
))
top_stats = snapshot.statistics(key_type=key_type, cumulative=True)
for index, stat in enumerate(top_stats, 1):
frame = stat.traceback[0]
# replace "/path/to/module/file.py" with "module/file.py"
filename = os.sep.join(frame.filename.split(os.sep)[-2:])
if (stat.size / 1024 / 1024) < 1:
break
print("#%s: %s:%s: %.1f KiB"
% (index, filename, frame.lineno, stat.size / 1024))
line = linecache.getline(frame.filename, frame.lineno).strip()
if line:
print(' %s' % line)
other = top_stats[index:]
if other:
size = sum(stat.size for stat in other)
print("%s other: %.1f MiB" % (len(other), size / 1024 / 1024))
total = sum(stat.size for stat in top_stats)
print("Total allocated size: %.1f MiB" % (total / 1024 / 1024))
print("\nLast Snapshot")
last_trace = "/tmp/" + traces[-1]
snapshot = tracemalloc.Snapshot.load(last_trace)
display_top(snapshot) sometimes the last snapshot is corrupted because it was being saved when proccess got killed
right before instantiating a
RpmDeclarativeVersion