Spurious memory leak example from the wiki

I can't get the two examples (sum/product) in: https://wiki.haskell.org/Memory_leak#Holding_a_reference_for_a_too_long_time to behave differently under O2 or O0. Same profile report each time. Have changes to prelude (FTP? Rewrite rules/build stuff for folds?) made these do the same thing? The foldl/foldl' examples behave the same as you might expect. (216mb vs. 1mb of heap) --- Chris Allen

Hi, Am Montag, den 04.01.2016, 08:26 -0600 schrieb Christopher Allen:
I can't get the two examples (sum/product) in:
https://wiki.haskell.org/Memory_leak#Holding_a_reference_for_a_too_lo ng_time
to behave differently under O2 or O0.
Same profile report each time.
do you observe the leaking or the non-leaking behavior? Gruß, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

Here's the profiling report: 11,371,237,400 bytes allocated in the heap 6,880,974,648 bytes copied during GC 17,531,336 bytes maximum residency (848 sample(s)) 4,580,080 bytes maximum slop 51 MB total memory in use (5 MB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 18716 colls, 0 par 0.140s 0.137s 0.0000s 0.0003s Gen 1 848 colls, 0 par 4.324s 4.219s 0.0050s 0.0095s TASKS: 4 (1 bound, 3 peak workers (3 total), using -N1) SPARKS: 0 (0 converted, 0 overflowed, 0 dud, 0 GC'd, 0 fizzled) INIT time 0.000s ( 0.001s elapsed) MUT time 1.680s ( 1.884s elapsed) GC time 4.464s ( 4.356s elapsed) RP time 0.000s ( 0.000s elapsed) PROF time 0.000s ( 0.000s elapsed) EXIT time 0.004s ( 0.000s elapsed) Total time 6.280s ( 6.241s elapsed) Alloc rate 6,768,593,690 bytes per MUT second Productivity 28.9% of total user, 29.1% of total elapsed gc_alloc_block_sync: 0 whitehole_spin: 0 gen[0].sync: 0 gen[1].sync: 0 6.30user 0.10system 0:06.44elapsed 99%CPU (0avgtext+0avgdata 109020maxresident)k 0inputs+24outputs (0major+41639minor)pagefaults 0swaps I've attached a postscript of the heap profile, but that's from running it just now and it's dying on segfault before finishing execution now for...some reason. The above profiling report is from when I originally ran it.
From the segfault:
56109148054202365158913895741900770318778Command terminated by signal 11
6.79user 0.08system 0:06.96elapsed 98%CPU (0avgtext+0avgdata
125036maxresident)k
384inputs+120outputs (9major+44372minor)pagefaults 0swaps
Makefile:2: recipe for target 'profile' failed
make: *** [profile] Error 139
The numbers are from it trying to finish printing the result.
On Mon, Jan 4, 2016 at 2:21 PM, Joachim Breitner
Hi,
Am Montag, den 04.01.2016, 08:26 -0600 schrieb Christopher Allen:
I can't get the two examples (sum/product) in:
https://wiki.haskell.org/Memory_leak#Holding_a_reference_for_a_too_lo ng_time
to behave differently under O2 or O0.
Same profile report each time.
do you observe the leaking or the non-leaking behavior?
Gruß, Joachim
-- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Chris Allen Currently working on http://haskellbook.com
participants (2)
-
Christopher Allen
-
Joachim Breitner