unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Subject: Re: Garbage collector tuning?
Date: Thu, 10 Sep 2015 15:30:33 +0200	[thread overview]
Message-ID: <87fv2m5rly.fsf@gnu.org> (raw)
In-Reply-To: alpine.DEB.2.11.1509100733580.7865@wedemob

Jan Wedekind <jan@wedesoft.de> skribis:

> I wonder whether there is a more performant way to allocate larger
> memory blocks (e.g. 1 MByte). "gc-malloc-pointerless" seems to be much
> slower than "malloc":
>
>                                            user     system      total        real
>     Guile allocate memory              0.003780   0.000020   0.003800 (  0.003810)
>     C allocate memory                  0.000060   0.000000   0.000060 (  0.000070)

It isn’t fair to compare GC_malloc_pointerless with malloc.  Instead, it
should be compared with interleaved malloc + free sequences.

You should find more on this topic on the home page of libgc, the GC
that Guile uses: <http://www.hboehm.info/gc/>

> Is there a way to control how often the garbage collector is run?

The file doc/README.environment in libgc describes some useful
environment variables, notably these:

  GC_INITIAL_HEAP_SIZE=<bytes> -	Initial heap size in bytes.  May speed up
                                  process start-up.

  GC_MAXIMUM_HEAP_SIZE=<bytes> - Maximum collected heap size.

  GC_MARKERS=<n> - Linux w/threads and parallel marker only.  Set the number
                  of marker threads.  This is normally set to the number of
                  processors.  It is safer to adjust GC_MARKERS than GC_NPROCS,
                  since GC_MARKERS has no impact on the lock implementation.

Guile also honors the ‘GC_FREE_SPACE_DIVISOR’ environment variable.  See
the comments in gc.h for the meaning of this one.

HTH,
Ludo’.




  reply	other threads:[~2015-09-10 13:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  6:46 Garbage collector tuning? Jan Wedekind
2015-09-10 13:30 ` Ludovic Courtès [this message]
2015-09-10 15:51   ` Stefan Israelsson Tampe
2015-09-10 16:33   ` Jan Wedekind
2015-09-10 17:07   ` Jan Wedekind
2015-09-10 17:54     ` David Pirotte
2015-09-10 21:37       ` Jan Wedekind

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=87fv2m5rly.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@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).