unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: guile-devel@gnu.org
Subject: Re: GUILE_MAX_HEAP_SIZE
Date: Fri, 15 Aug 2008 21:43:11 -0300	[thread overview]
Message-ID: <g857t6$mmp$1@ger.gmane.org> (raw)
In-Reply-To: <87ej4tmf4m.fsf@gnu.org>

Ludovic Courtès escreveu:
> Hi Han-Wen,
> 
> Han-Wen Nienhuys <hanwen@xs4all.nl> writes:
> 
>> I've implemented an env var GUILE_MAX_HEAP_SIZE (- some lilypond users
>> were complaining that running lily on large sets of files keeps
>> growing the heap forever, leading to trashing).
> 
> Of course, the correct fix would be to help the GC be more reasonable,
> as it's currently somewhat broken:
> 
>   http://thread.gmane.org/gmane.lisp.guile.devel/6699/focus=6832

> Also, it gives me the impression that we've definitely lost control over
> the GC code, and we're adding yet another configuration variable to work
> around that.  :-(

Hi,

I did a cleanup round over the GC code - see the dev/hanwen branch on
sv.gnu.org ; It seems to work ok, there is a just one annoyance: there
is a commented out assert that works most of the time, but once in a
while is off by a small amount in either direction.  Comments/insights
appreciated.

Unfortunately, I am not the patient type, and also not aflush with
free time, so the changes come as one big bunch, with layout,
refactoring and some bugfixes all lumped together.

(I intend to squash into a single commit before pushing to master).



Garbage collection cleanup.

* Remove data that might be out of date; remove
  scm_i_adjust_min_yield().  We don't store min_yields, since they
  are only accurate at one point in time (when the sweep finishes). 
  We decide the min yield at that point from min_yield_fraction and
  freelist->collected / freelist->swept

* Introduce scm_i_gc_heap_size_delta() replacing
  scm_i_gc_grow_heap_p().
  
* Remove foo_1 fields containing penultimate results.

* After GC, count mark bit vector to discover number of live
  objects. This simplifies hairy updates.

* Many formatting and layout cleanups.

* Fix in scm_i_sweep_card(): return the length of free_list returned,
  rather than number of deleted objects.

* For mtrigger GCs: do not also run a full sweep after the gc() call, as
  this is inconsistent with lazy sweeping.

* Remove scm_i_make_initial_segment().

* Use calloc in scm_i_make_empty_heap_segment() to save on init's.

* New function scm_i_sweep_for_freelist() which sweeps, with proper
  statistic variable updates.

* New segments are conceptually blocks with 100% reclaimable cells.

* Remove some useless constants/comments: SCM_HEAP_SIZE,
  SCM_INIT_HEAP_SIZE, SCM_EXPHEAP, SCM_HEAP_SEG_SIZE

* Do not increment scm_cells_allocated() from the
  scm_[double]cell(). This would be a race condition.

* Move some deprecation checks in separate functions to not distract
  from main code flow.




-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen





  parent reply	other threads:[~2008-08-16  0:43 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  5:11 GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-13  9:35 ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-13 15:04   ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-14  5:09   ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-14  7:56     ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-16 19:13       ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-16 19:24         ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-17 21:51         ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-18 19:08           ` GUILE_MAX_HEAP_SIZE Andy Wingo
2008-08-21 20:27             ` Gnulib files now in the repository Ludovic Courtès
2008-08-16  0:43   ` Han-Wen Nienhuys [this message]
2008-08-16  0:47     ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-17 22:26     ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-18  7:43       ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-18 14:18         ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-18 14:31           ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-18 15:34           ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-19  8:54             ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-19 13:53               ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-19 15:46                 ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-21 18:36                   ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-22  2:06                     ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-22  3:36                       ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-22 18:46                         ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-09-09 20:50                           ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-09-10  2:05                             ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-09-10  7:38                               ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-22  2:29                     ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-22  7:39                       ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-18  7:54       ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-18 14:10       ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-18 15:48         ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-19  8:22           ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-18 15:55         ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-19  8:10           ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-19  8:16             ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-19 23:03             ` GOOPS memory corruption in `go_to_hell ()' Ludovic Courtès
2008-08-19  9:00       ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
2008-08-22  9:42     ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-22 22:32       ` GUILE_MAX_HEAP_SIZE Ludovic Courtès
2008-08-23  2:25       ` GUILE_MAX_HEAP_SIZE Han-Wen Nienhuys
  -- strict thread matches above, loose matches on Subject: below --
2008-08-14 11:49 GUILE_MAX_HEAP_SIZE dsmich
2008-08-14 12:32 ` GUILE_MAX_HEAP_SIZE Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g857t6$mmp$1@ger.gmane.org' \
    --to=hanwen@xs4all.nl \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).