I was not able to reproduce a decisive difference in memory consumption
between before and after patch 'plugging memory leak in annotate'. I
would rebase this patch if it weren't already in screened.
Re peak memory increase: I have tested this with a somewhat more extreme
example repo. This repo contains about 600 patches that all modify a
single file (~15000 lines of json). This repo was my initial motivation
for re-implementing annotate. In the following have elided irrelevant
parts of the RTS output.
Before:
10,397,285,400 bytes allocated in the heap
26,784,355,256 bytes copied during GC
1,038,980,636 bytes maximum residency (217 sample(s))
23,257,040 bytes maximum slop
2607 MB total memory in use (589 MB lost due to fragmentation)
MUT time 54.687s ( 76.714s elapsed)
GC time 57.521s ( 63.233s elapsed)
Total time 112.449s (140.173s elapsed)
After:
5,188,947,404 bytes allocated in the heap
3,974,428,900 bytes copied during GC
408,305,932 bytes maximum residency (34 sample(s))
7,009,744 bytes maximum slop
910 MB total memory in use (0 MB lost due to fragmentation)
MUT time 4.884s ( 5.171s elapsed)
GC time 11.183s ( 11.184s elapsed)
Total time 16.087s ( 16.358s elapsed)
All memory consumption is reduced significantly, including peak.
With your test example (darcs.cabal) I see that peak memory as well as
'maximum residency' is sightly increased. I am pretty sure this is an
artefact caused by low memory pressure together with a faster program
(thus fast allocation rate). When I limit the heap using +RTS -M22M I
get smaller values for peak as well as maximum residency for the second
version (after applying the two patches).
|