Closed Bug 127092 Opened 24 years ago Closed 24 years ago

Heap Analysis instrumentation in code

Categories

(SeaMonkey :: General, defect, P2)

x86
Windows 2000
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: dp, Assigned: dp)

Details

(Keywords: memory-footprint)

Attachments

(1 file, 5 obsolete files)

Would be nice to have code in release builds to get heap statistics.
Goals for instrumentation: - Ultra light weight - Non-interfering with any operation - triggered explicitly
Status: NEW → ASSIGNED
Keywords: footprint
Priority: -- → P2
Target Milestone: --- → mozilla1.0
Attached patch First draft at heap analysis (obsolete) — Splinter Review
The code is enalbed by setting set MOZ_CFLAGS=MOZ_HEAP_STATISTICS This is a compile time switch. Output is analyzed by perl script mozilla/tools/footprint/heapmap.pl
Attached patch better ifdeffing (obsolete) — Splinter Review
set MOZ_CFLAGS=-DMOZ_HEAP_STATISTICS cd xpfe/appshell/src make
Attachment #70786 - Attachment is obsolete: true
Keywords: nsbeta1
Attached patch Heapdump on MOZ_HeapDump message (obsolete) — Splinter Review
Dumps heap to c:\heapdump.txt when app gets the message MOZ_HeapDump
Attachment #70794 - Attachment is obsolete: true
Protects against use of HeapWalk() and GetProcessHeaps() from win98 where they dont exist.
Attachment #70981 - Attachment is obsolete: true
Comment on attachment 70988 [details] [diff] [review] Protecting agaist win98 (thanks Garrett) r=blythe
Attachment #70988 - Flags: review+
rpotts/brendan : sr=? mozilla/tools/footprint : heapdump.cpp : sends the MOZ_HeapDump message to mozilla heapmap.pl : perl script that analyzes the heap dump I am hoping to get this into 0.9.9 USED heap and heap overhead would be the metrics
Small heap allocator isn't showing up in heapwalk. On win2k, non-debug CRT (MSVCRT) doesn't use small heap. MSVCDRT (debug CRT) seems to be using it for win2k. Disabling this altogether for debug builds only. Effect: - Accurate heap numbers on win2k debug builds - Win98 uses it. But we dont have heapwalk() on win98. So no accurate measurement. And release builds will not be affected.
Comment on attachment 71001 [details] [diff] [review] Disabling small heap allocator for debug builds r=blythe
Attachment #71001 - Flags: review+
Attachment #71001 - Flags: superreview+
Comment on attachment 71001 [details] [diff] [review] Disabling small heap allocator for debug builds sr=brendan@mozilla.org, but if rpotts wants to override me, I defer to him. /be
BTW, I have #if defined(DEBUG) && defined(XP_WIN32) around the #include "malloc.h" in the second patch.
Comment on attachment 70988 [details] [diff] [review] Protecting agaist win98 (thanks Garrett) sr=brendan@mozilla.org, jwz would want you to spell out Mozilla, not use MOZ_... -- write a letter! /be
Attachment #70988 - Flags: superreview+
Target Milestone: mozilla1.0 → mozilla0.9.9
looks good to me -- go for it! -- rick
Comment on attachment 70988 [details] [diff] [review] Protecting agaist win98 (thanks Garrett) a=shaver for 0.9.9.
Attachment #70988 - Flags: approval+
Comment on attachment 71001 [details] [diff] [review] Disabling small heap allocator for debug builds a=shaver for 0.9.9
Attachment #71001 - Flags: approval+
Marking previous two patches obsolete as they are approved and checked in. This new patch is derived from my greated understanding of the windows allocator. HEAPs have multiple REGIONS in them which have blocks that are either USED, FREE or UNCOMMITTED (just Vm and hasnt been mapped into physical memory or swap). Getting this detail printed into the heapdump file. Will modify perl analysis script : mozilla/tools/footprint/heapmap.pl to parse this new format.
Attachment #70988 - Attachment is obsolete: true
Attachment #71001 - Attachment is obsolete: true
shaver: can you just approve the patch. This is just a print format change in code that only gets called for heapdump which no user will every encounter.
Comment on attachment 71689 [details] [diff] [review] Fine tuning the heapdump output r=dp
Attachment #71689 - Flags: review+
Comment on attachment 71689 [details] [diff] [review] Fine tuning the heapdump output I meant r=blythe
All instrumentation checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: