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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 981BCBC37 for ; Wed, 10 Feb 2010 18:47:29 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AspBAKZ/cktQW+UMgWdsb2JhbACPAYIQiVIVAQEWJCO9FIRVBIVZ X-IronPort-AV: E=Sophos;i="4.49,445,1262559600"; d="scan'208";a="56720044" Received: from lo.gmane.org ([80.91.229.12]) by mail4-smtp-sop.national.inria.fr with ESMTP; 10 Feb 2010 18:47:29 +0100 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NfGer-0005FM-Eg for caml-list@inria.fr; Wed, 10 Feb 2010 18:47:25 +0100 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Feb 2010 18:47:25 +0100 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Feb 2010 18:47:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: Being aware of memory overuse Date: Wed, 10 Feb 2010 17:47:03 +0000 (UTC) Message-ID: References: <876365o4wy.fsf@frosties.localdomain> <654922.88817.qm@web111503.mail.gq1.yahoo.com> X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/pre1.0.0-11 (Linux) Sender: news X-Spam: no; 0.00; le-gall:01 invocation:01 ocaml:01 ocaml:01 bindings:01 wrote:01 data:02 kernel:02 kernel:02 correctly:04 proposals:05 paths:05 discussion:06 linux:07 cases:08 On 10-02-2010, Dario Teixeira wrote: > Hi, > >> I always wanted to have kernel spport for this. Some way for aplication >> to tell the kernel about freeable memory and for the kernel to request >> some memory to be freeed instead of swapping it out. > > If I recall correctly, there was an Lwn.net article reporting a lkml > (the Linux kernel mailing list) discussion on that subject. One of > the proposals was for the kernel to send processes a signal (SIGFREE?) > requesting they free up memory (by running a major GC, for example) > whenever memory was running low. In theory this could in some cases > avoid the invocation of the draconian OOM killer. > > Question: just how effective such a feature would be in the Ocaml case? > > I forgot to tell about other paths I have followed: setrlimit/getrlimit. There are limits like RLIMIT_DATA, RLIMIT_RSS et al (CPU...). setrlimit limits memory by generating ENOMEM when limits are reached and getrlimit should give information about the current level of use of these limits. Unfortunately, the memory consumption I get with getrlimit is not accurate (in fact not updated). I have OCaml bindings for this, I should published in a near future. Regards, Sylvain Le Gall