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
Being aware of memory overuse
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-02-05 (10:34)
From: David Rajchenbach-Teller <David.Teller@m...>
Subject: Being aware of memory overuse
       Dear list,
 I'm writing some code that needs to be able to cope nicely with memory exhaustion. That is, it should be able to detect at some point if it is getting close to exhausting memory, and take the necessary course of action (e.g. bailing out nicely). I'm wondering what's the best way of doing this. I've been thinking about installing a [Gc.alarm] and checking [Gc.free_words], [Gc.free_blocks], [Gc.largest_free] just after each major cycle, but I'm wondering if it's the best technique.

Any suggestion?

Thanks in advance,

David Rajchenbach-Teller
 Head of R&D