Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] troubleshooting problem related to garbage collection
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: james woodyatt <jhw@w...>
Subject: Re: [Caml-list] troubleshooting problem related to garbage collection
On Friday, March 1, 2002, at 10:52 AM, james woodyatt wrote:
> Last night I spent a lot of time trying to figure out why an assertion 
> was failing in my code when I use it with large data sets.  I'm still 
> puzzled.
> This morning, I inserted the following at the beginning of my main 
> module:
>> Gc.set {
>>     (Gc.get ()) with
>>     Gc.major_heap_increment = 64000
>> }
> This made the problem go away.

Further investigation reveals that it does not make the problem go away, 
it changes the failure mode into one that only makes it look like the 
problem has gone away.  The process terminates prematurely (but there 
was no more output expected anyway).

> What's even more strange is that there are multiple failure modes to 
> choose from depending on which number I pick for the 
> major_heap_increment value.  The number I am using here just happens to 
> be the one that makes the code work.
> Can anyone advise me on how to find the bug here?

I've found the problem.  It was a function trying too hard not to blit a 
string.  The bug only manifested when writing to a non-blocking TCP 
socket would return a value less than the number of octets to send.

This makes me think that when similar problems arise-- i.e. when 
changing the parameters of the GC seems to make always-reproduceable 
misbehavior change in some remarkable way-- the first place to start 
looking for the cause is code that blits strings.

j h woodyatt <>
"...the antidote to misinformation is more information, not less."
                                                      --vinton cerf

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: