lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memleaks or not?


From: Reinhold Kainhofer
Subject: Re: Memleaks or not?
Date: Sat, 3 Sep 2011 16:59:14 +0200
User-agent: KMail/1.13.6 (Linux/2.6.38-10-generic; KDE/4.7.0; i686; ; )

Am Wednesday, 24. August 2011, 20:30:20 schrieb Reinhold Kainhofer:
> Running lilypond on a lot of files in one run, I observe that lilypond's
> memory usage slowly goes up with time, i.e. it seems that lilypond does not
> properly free all memory used for one score, before it starts with the next
> one.

Following up on this, I have discovered the (check-memory) scheme function in 
lily.scm and let it display some Scheme memory stats when running on multiple 
files:

After the first file we have:
Processing `accidental-ancient.ly'
VMDATA: 91360
((gc-time-taken . 15) (cells-allocated . 4117699) (total-cells-allocated . 
5066751) (cell-heap-size . 10737028) (bytes-malloced . 3726859) (gc-malloc-
threshold . 4037751) (gc-times . 6) (gc-mark-time-taken . 15) (cells-marked . 
34142411.0) (cells-swept . 35398335.0) (malloc-yield . 23) (cell-yield . 17) 
(protected-objects . 1177) (cell-heap-segments (140744704 . 140779520) 
(2988156928 . 3044208640) (3047643136 . 3067260928) (3067570176 . 
3078098944)))


But after compiling all regtests starting with [abc]*.ly, we have:

Processing `custos.ly'
VMDATA: 120884
((gc-time-taken . 2623) (cells-allocated . 75745641) (total-cells-allocated . 
513621680) (cell-heap-size . 10737028) (bytes-malloced . 35585796) (gc-malloc-
threshold . 45739370) (gc-times . 227) (gc-mark-time-taken . 2623) (cells-
marked . 2013812174.0) (cells-swept . 2451995085.0) (malloc-yield . 12) (cell-
yield . 20) (protected-objects . 2576) (cell-heap-segments (140744704 . 
140779520) (2988156928 . 3044208640) (3047643136 . 3067260928) (3067570176 . 
3078098944)))


Notice that the VMDATA goes up (almost linearly in the files processed), and 
similarly the bytes-malloced, as well as the protected-objects and most other 
counts. 
The cells-allocated got up, too, although I don't really know what "cells" 
really means here.

Since I really don't know too much about the internals of guile, the question 
that immediately comes to my mind: Doesn't this indicate that we don't release 
all guile memory after processing a file? In particular, are we missing some 
objects from garbage collection, or are we not removing the used mark of some 
SCM objects after one file is finished?

Cheers,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]