946
edits
(Moved from "Footprint Brownbag", http://www.mozilla.org/performance/footprint-brownbag.html, originally by Suresh Duddi <dp@netscape.com> and Garrett Blythe <blythe@netscape.com>) |
No edit summary |
||
Line 53: | Line 53: | ||
# Look at task manager on windows or top on unix (mac?) to see total memory consumed at a given time. On windows, remember to iconify and show the window before you read the memory usage from the task manager. | # Look at task manager on windows or top on unix (mac?) to see total memory consumed at a given time. On windows, remember to iconify and show the window before you read the memory usage from the task manager. | ||
# BloatView - Trust only the number of object created of a particular type http://lxr.mozilla.org/mozilla/source/xpcom/doc/MemoryTools.html | # BloatView - Trust only the number of object created of a particular type http://lxr.mozilla.org/mozilla/source/xpcom/doc/MemoryTools.html | ||
#: set XPCOM_MEM_BLOAT_LOG=1 (run time) | |||
set XPCOM_MEM_BLOAT_LOG=1 (run time) | |||
# Space Trace - http://mozilla.org/projects/footprint/spaceTrace.html | # Space Trace - http://mozilla.org/projects/footprint/spaceTrace.html | ||
TraceMalloc based query tool for individual allocations and how long they lived. Written by Garrett Blythe <blythe@netscape.com> | TraceMalloc based query tool for individual allocations and how long they lived. Written by Garrett Blythe <blythe@netscape.com> | ||
Line 62: | Line 60: | ||
# Reduce data structure / object sizes | # Reduce data structure / object sizes | ||
* Promote unused members of frequently used objects into parent/owner of object as lists (space/time tradeoff). E.g DOM | #* Promote unused members of frequently used objects into parent/owner of object as lists (space/time tradeoff). E.g DOM | ||
* vtable does take 1 word (4 bytes) per direct interface | #* vtable does take 1 word (4 bytes) per direct interface | ||
* Alignment - word align members of objects. A simple rule of thumb is keep variables of same type together. | #* Alignment - word align members of objects. A simple rule of thumb is keep variables of same type together. | ||
* delay load/create | #* delay load/create | ||
# Focus on objects created many times and held longer ( Space Trace ) | # Focus on objects created many times and held longer ( Space Trace ) | ||
# space / time tradeoff - Ways for handling them could be | # space / time tradeoff - Ways for handling them could be |
edits