| Index: chrome/test/pyautolib/remote_inspector_client.py
|
| diff --git a/chrome/test/pyautolib/remote_inspector_client.py b/chrome/test/pyautolib/remote_inspector_client.py
|
| index bda06c7ebef254b27e3e005115144c35ccc99e88..9e9fa011c3251f9a18f4e9e95a7ca0a2a6e76ed0 100755
|
| --- a/chrome/test/pyautolib/remote_inspector_client.py
|
| +++ b/chrome/test/pyautolib/remote_inspector_client.py
|
| @@ -711,6 +711,11 @@ class NativeMemorySnapshot(object):
|
| Public Methods:
|
| GetProcessPrivateMemorySize: The process total size.
|
| GetUnknownSize: Size of not instrumented parts.
|
| + GetInstrumentedObjectsCount: Number of instrumented objects traversed by
|
| + DevTools memory instrumentation.
|
| + GetNumberOfInstrumentedObjectsNotInHeap: Number of instrumented objects
|
| + visited by DevTools memory instrumentation that haven't been allocated
|
| + by tcmalloc.
|
| FindMemoryBlock: Given an array of memory block names return the block.
|
| """
|
| def __init__(self, root_block):
|
| @@ -726,6 +731,31 @@ class NativeMemorySnapshot(object):
|
| known_size += child['size']
|
| return self.GetProcessPrivateMemorySize() - known_size
|
|
|
| + def GetInstrumentedObjectsCount(self):
|
| + """Returns number of objects visited by DevTools memory instrumentation.
|
| +
|
| + Returns:
|
| + Number of known instrumented objects or None if it is not available.
|
| + """
|
| + memory_block = self.FindMemoryBlock(['ProcessPrivateMemory',
|
| + 'InstrumentedObjectsCount'])
|
| + if not memory_block is None:
|
| + return memory_block['size']
|
| + return None
|
| +
|
| + def GetNumberOfInstrumentedObjectsNotInHeap(self):
|
| + """Returns number of instrumented objects unknown to tcmalloc.
|
| +
|
| + Returns:
|
| + Number of known instrumented objects that are not allocated by tcmalloc,
|
| + None if it is not available.
|
| + """
|
| + memory_block = self.FindMemoryBlock(['ProcessPrivateMemory',
|
| + 'InstrumentedButNotAllocatedObjectsCount'])
|
| + if not memory_block is None:
|
| + return memory_block['size']
|
| + return None
|
| +
|
| def FindMemoryBlock(self, path):
|
| """Find memory block with given path.
|
|
|
|
|