mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 02:35:41 +00:00
0f418f3874
DMD currently uses a very hacky form of "sampling" by default to avoid recording stack traces for all blocks. This makes DMD run faster than when it records all stack traces. This patch changes the sampling method used; in fact, it avoids "sampling" at all. The existence of all heap blocks is now recorded exactly, but by default we only record an allocation stack for each heap block if a Bernoulli trial succeeds. This choice works well because getting the stack trace is ~100x slower than recording the block's existence. Overall, this approach is simpler and it also gives better output -- the choice of which blocks to record allocation stacks for is mathematically sound, no stack trace gets blamed for allocations it didn't do, and block counts and sizes are now always exact. Other specific things changed. - All notion of sampling is removed from the various data structures. - The --sample-below option is removed in favour of --stacks={partial,full}. - The format of the JSON output file has changed. - The names of various test files have changed to reflect concept changes. --HG-- rename : memory/replace/dmd/test/full-empty-cumulative-expected.txt => memory/replace/dmd/test/complete-empty-cumulative-expected.txt rename : memory/replace/dmd/test/full-empty-dark-matter-expected.txt => memory/replace/dmd/test/complete-empty-dark-matter-expected.txt rename : memory/replace/dmd/test/full-empty-live-expected.txt => memory/replace/dmd/test/complete-empty-live-expected.txt rename : memory/replace/dmd/test/full-unsampled1-dark-matter-expected.txt => memory/replace/dmd/test/complete-full1-dark-matter-expected.txt rename : memory/replace/dmd/test/full-unsampled1-live-expected.txt => memory/replace/dmd/test/complete-full1-live-expected.txt rename : memory/replace/dmd/test/full-unsampled2-cumulative-expected.txt => memory/replace/dmd/test/complete-full2-cumulative-expected.txt rename : memory/replace/dmd/test/full-unsampled2-dark-matter-expected.txt => memory/replace/dmd/test/complete-full2-dark-matter-expected.txt rename : memory/replace/dmd/test/full-sampled-live-expected.txt => memory/replace/dmd/test/complete-partial-live-expected.txt extra : rebase_source : 47d287405dc5e9075f08addaba49e879c2c6e23f
49 lines
1.1 KiB
Plaintext
49 lines
1.1 KiB
Plaintext
#-----------------------------------------------------------------
|
|
# dmd.py --filter-stacks-for-testing -o script-max-frames-3-actual.txt --max-frames=3 --no-fix-stacks script-max-frames.json
|
|
|
|
Invocation {
|
|
$DMD = '--mode=live --stacks=full'
|
|
Mode = 'live'
|
|
}
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
Live {
|
|
2 blocks in heap block record 1 of 3
|
|
4,224 bytes (4,224 requested / 0 slop)
|
|
Individual block sizes: 4,096; 128
|
|
95.65% of the heap (95.65% cumulative)
|
|
Allocated at {
|
|
#01: E (E.cpp:99)
|
|
#02: F (F.cpp:99)
|
|
#03: G (G.cpp:99)
|
|
}
|
|
}
|
|
|
|
Live {
|
|
1 block in heap block record 2 of 3
|
|
112 bytes (100 requested / 12 slop)
|
|
2.54% of the heap (98.19% cumulative)
|
|
Allocated at {
|
|
#01: E (E.cpp:99)
|
|
#02: X (X.cpp:99)
|
|
#03: Y (Y.cpp:99)
|
|
}
|
|
}
|
|
|
|
Live {
|
|
1 block in heap block record 3 of 3
|
|
80 bytes (80 requested / 0 slop)
|
|
1.81% of the heap (100.00% cumulative)
|
|
Allocated at {
|
|
#01: E (E.cpp:99)
|
|
}
|
|
}
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
Summary {
|
|
Total: 4,416 bytes in 4 blocks
|
|
}
|
|
|