projects
/
platform
/
framework
/
web
/
crosswalk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git]
/
src
/
tools
/
memory_inspector
/
memory_inspector
/
classification
/
native_heap_classifier.py
diff --git
a/src/tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py
b/src/tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py
index
c837ee5
..
e424afc
100644
(file)
--- a/
src/tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py
+++ b/
src/tools/memory_inspector/memory_inspector/classification/native_heap_classifier.py
@@
-34,7
+34,7
@@
from memory_inspector.core import exceptions
from memory_inspector.core import native_heap
from memory_inspector.core import native_heap
-_RESULT_KEYS = ['bytes_allocated']
+_RESULT_KEYS = ['bytes_allocated'
, 'bytes_resident'
]
def LoadRules(content):
def LoadRules(content):
@@
-61,7
+61,8
@@
def Classify(nativeheap, rule_tree):
res = results.AggreatedResults(rule_tree, _RESULT_KEYS)
for allocation in nativeheap.allocations:
res = results.AggreatedResults(rule_tree, _RESULT_KEYS)
for allocation in nativeheap.allocations:
- res.AddToMatchingNodes(allocation, [allocation.total_size])
+ res.AddToMatchingNodes(allocation,
+ [allocation.size, allocation.resident_size])
return res
return res
@@
-125,8
+126,8
@@
def InferHeuristicRulesFromHeap(nheap, max_depth=3, threshold=0.02):
continue
# Add the blamed dir to the leaderboard.
blamed_dir = dir_histogram.most_common()[0][0]
continue
# Add the blamed dir to the leaderboard.
blamed_dir = dir_histogram.most_common()[0][0]
- blamed_dirs.update({blamed_dir : alloc.
total_
size})
- total_allocated += alloc.
total_
size
+ blamed_dirs.update({blamed_dir : alloc.size})
+ total_allocated += alloc.size
# Select only the top paths from the leaderboard which contribute for more
# than |threshold| and make a radix tree out of them.
# Select only the top paths from the leaderboard which contribute for more
# than |threshold| and make a radix tree out of them.