English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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