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] Memory leak with native code.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-12-05 (20:31)
From: Basile STARYNKEVITCH <basile@s...>
Subject: [Caml-list] Memory leak with native code.
>>>>> "David" == David Brown <> writes:

    David> I have a fairly complex program that has numerous callbacks
    David> between Ocaml, C and back to Ocaml (I'm using Debian's
    David> 3.06).

    David> If I compile my program byte-code, it works well.

    David> However, if I compile it native, it seems to leak memory,
    David> just consuming more and more memory as it runs.

I assume your plateform is x86 on Debian. Because of the small number
of registers, tail-recursion is limited to 5 arguments (if my memory
serves me well). For more arguments, a tail-rec is not a loop on
x86. Perhaps this could be your problem (just a guess, I encountered
it several years ago and reported to the mailing list). Then you might
merge several arguments into a tuple or record.  Or switch to
plateform with more registers!

Just a wild guess! The Caml team will confirm (or infirm) it.


email: basile<at>starynkevitch<dot>net 
alias: basile<at>tunes<dot>org 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: