chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] heap size or macro problem


From: felix winkelmann
Subject: Re: [Chicken-users] heap size or macro problem
Date: Mon, 5 Nov 2007 08:06:53 +0100

Hi, Rick!


If you get something like "out of memory - heap full", then this is most
likely a FFI-related problem. It happens sometimes that Scheme data
objects get corrupted by foreign or lowlevel code and a field that contains
the size of an allocated object ends up containing a pointer. On the
next garbage collection (which happen very frequently, due to the
compilation strategy used) this size field will contain a usually large number
and reallocation of the heap will fail due to the large allocation request.
This effect depends highly on the allocation pattern, so seemingly
tiny things can completely change the point at which a GC fails (like
evaluating some code or so).

The first thing to check is whether you perform any Scheme->C calls
with callbacks into Scheme: if these are not properly declared as "safe",
since this always (sooner or later) leads to trouble. Changing the heap-
size or so hasn't much use, the heap should grow and shrink
automatically and if it doesn't, then there is something wrong.

Can you run your application under valgrind?


cheers,
felix




reply via email to

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