From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 08ADFBBAF for ; Fri, 5 Feb 2010 11:34:30 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApgAACODa0vZRrJMf2dsb2JhbACbUwEBCQsMBRUFulKETAQ X-IronPort-AV: E=Sophos;i="4.49,412,1262559600"; d="scan'208";a="43297640" Received: from relay2-v.mail.gandi.net ([217.70.178.76]) by mail2-smtp-roc.national.inria.fr with ESMTP; 05 Feb 2010 11:34:29 +0100 Received: from [192.168.1.140] (unknown [213.144.210.93]) by relay2-v.mail.gandi.net (Postfix) with ESMTP id 754E1135E7 for ; Fri, 5 Feb 2010 11:34:29 +0100 (CET) From: David Rajchenbach-Teller Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Being aware of memory overuse Date: Fri, 5 Feb 2010 11:34:29 +0100 Message-Id: To: caml-list@inria.fr Mime-Version: 1.0 (Apple Message framework v1077) X-Mailer: Apple Mail (2.1077) X-Spam: no; 0.00; checking:02 suggestion:03 blocks:07 head:90 i'm:09 i'm:09 memory:09 memory:09 wondering:09 wondering:09 nicely:10 nicely:10 exhaustion:11 detect:11 installing:12 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 --=20 David Rajchenbach-Teller Head of R&D MLstate