diff options
author | Mark Probst <mark.probst@gmail.com> | 2010-10-18 16:30:39 +0400 |
---|---|---|
committer | Mark Probst <mark.probst@gmail.com> | 2010-11-07 04:45:57 +0300 |
commit | 7660facddecde450d0c7db010700b83ddea5f57b (patch) | |
tree | fbf479257ff5fb892ababaa4c70300f55cdd6359 /scripts | |
parent | 73f1564d9da6ac529be39bbf1491100bf6c5c30d (diff) |
[sgen] Dump Mark&Sweep heap occupancy.
For each block size dump the occupancy to the heap-dump
file.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mono-heapviz | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/mono-heapviz b/scripts/mono-heapviz index fe13da6c7f8..27b6f7f6023 100755 --- a/scripts/mono-heapviz +++ b/scripts/mono-heapviz @@ -156,6 +156,7 @@ class DocHandler (ContentHandler): self.usage = {} self.los_usage = {} self.pinned_usage = {} + self.occupancies = {} self.in_los = False self.in_pinned = False self.heap_used = 0 @@ -169,6 +170,13 @@ class DocHandler (ContentHandler): kind = attrs.get('type', None) bytes = int(attrs.get('bytes', None)) print ('Pinned from %s: %d kB<br>' % (kind, bytes / 1024), file = self.collection_file) + elif name == 'occupancy': + size = int (attrs.get ('size', None)) + available = int (attrs.get ('available', None)) + used = int (attrs.get ('used', None)) + unused = available - used + + print ('Occupancy of %d byte slots: %d / %d (%d kB / %d%% wasted)<br>' % (size, used, available, unused * size / 1024, unused * 100 / available), file = self.collection_file) elif name == 'section': kind = attrs.get('type', None) size = int(attrs.get('size', None)) |