From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: cell heap usage in 1.8 vs 1.6 Date: Fri, 17 Aug 2007 10:28:35 +1000 Message-ID: <87ir7ff1ho.fsf@zip.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187310785 26631 80.91.229.12 (17 Aug 2007 00:33:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Aug 2007 00:33:05 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Aug 17 02:33:03 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ILplu-0007Sz-N7 for guile-devel@m.gmane.org; Fri, 17 Aug 2007 02:33:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILplu-0006Xu-3a for guile-devel@m.gmane.org; Thu, 16 Aug 2007 20:33:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILpia-0004RA-Jz for guile-devel@gnu.org; Thu, 16 Aug 2007 20:29:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILpiZ-0004Pq-DG for guile-devel@gnu.org; Thu, 16 Aug 2007 20:29:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILpiZ-0004Pg-8j for guile-devel@gnu.org; Thu, 16 Aug 2007 20:29:35 -0400 Original-Received: from mailout2-7.pacific.net.au ([61.8.2.230] helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ILpiY-0003dZ-JF for guile-devel@gnu.org; Thu, 16 Aug 2007 20:29:35 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id D61D6C0614 for ; Fri, 17 Aug 2007 10:29:16 +1000 (EST) Original-Received: from localhost (ppp2FC8.dyn.pacific.net.au [61.8.47.200]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 930418C07 for ; Fri, 17 Aug 2007 10:29:22 +1000 (EST) Original-Received: from gg by localhost with local (Exim 4.67) (envelope-from ) id 1ILphb-0001Ie-CT for guile-devel@gnu.org; Fri, 17 Aug 2007 10:28:35 +1000 User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6699 Archived-At: I'm having trouble in my charting program with the amount of heap space allocated for cells in 1.8. It ends up allocating more and more heap (as reported by gc-stats 'cell-heap-segments and confirmed by mallinfo()), apparently without bound. I've got between 150k and 200k objects according to gc-live-object-stats, which should be about 5Mb of cells, but the heap keeps growing to as much as 60Mb. The same code seems ok in 1.6, it lives happily in about 5Mb of heap, though it does seem to do a few more gc's than 1.8. A backport of gc-live-object-stats to 1.6 says the objects in use are about the same there. I stuck in lots of printfs, which haven't told me much so far, except that the "collected" counts seem to be lower than I'd expect, and cause min_yield to be increased, and the heap then added to (every few gc's). Should the collected counts end up basically as "heapsize - liveobjects" every time? They seem to be smaller than that, but I don't know where to look for how or why. scm_i_sweep_segment() looks slightly doubtful. Does it deliberately not count the balance of a lazy sweep towards the collected counts? I wondered if a gc is provoked by the double cells being exhausted but only a little of the single cells having been collected, leaving a small collected count in the latter (or vice versa). Alas I don't have a simple program to provoke the problem. Perhaps some other big or long run program users could look at their heap consumption vs live objects, to see if it's just me. (define (total-heap) (apply + (map (lambda (elem) (abs (- (cdr elem) (car elem)))) (assoc-ref (gc-stats) 'cell-heap-segments)))) (define (count-alive) (apply + (map cdr (gc-live-object-stats)))) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel