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 36967BC37 for ; Wed, 10 Feb 2010 22:31:22 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhcBAGe0ckvZSMDdkGdsb2JhbACPBItiFQEBAQEJCQwHEwMgvjOEVQQ X-IronPort-AV: E=Sophos;i="4.49,446,1262559600"; d="scan'208";a="44353773" Received: from fmmailgate01.web.de ([217.72.192.221]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Feb 2010 22:31:21 +0100 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 487BF146AC13E; Wed, 10 Feb 2010 22:31:21 +0100 (CET) Received: from [95.208.117.111] (helo=frosties.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1NfK9Y-0004RX-00; Wed, 10 Feb 2010 22:31:20 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1NfK9Y-0004tP-6s; Wed, 10 Feb 2010 22:31:20 +0100 From: Goswin von Brederlow To: Dario Teixeira Cc: Sylvain Le Gall , Goswin von Brederlow , caml-list@inria.fr Subject: Re: [Caml-list] Re: Being aware of memory overuse References: <654922.88817.qm@web111503.mail.gq1.yahoo.com> Date: Wed, 10 Feb 2010 22:31:20 +0100 In-Reply-To: <654922.88817.qm@web111503.mail.gq1.yahoo.com> (Dario Teixeira's message of "Wed, 10 Feb 2010 05:43:10 -0800 (PST)") Message-ID: <87ljf0srpz.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX19xd1vpjQCKjpQMaY9GtOPQh3HAlHDxcQeJNbPN qMvrMlE9O6aUuBAe/l+eoF6bNU48pgY5dyibcmSYpepl3QN+7q 6GqG/slv0= X-Spam: no; 0.00; invocation:01 ocaml:01 caching:01 caching:01 mfg:98 caml-list:01 writes:01 kernel:02 kernel:02 face:97 correctly:04 proposals:05 anyway:05 variable:06 discussion:06 Dario Teixeira writes: > 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? > > Best regards, > Dario Teixeira The danger of this on the other hand is that starting a mjor GC cycle will most likely eat even more memory at first. A signal would probably not be so helpfull. I was thinking more about a memory preassure value. For example the kernel could provide a variable in the vdso block saying: 0-100: You should shrink your memory usage to that many % of current 100+: You could grow your memory to that many % of current The kernel could consider the processes memory use, amount used for caching in the process, other processes, general caching and the number of hits to the pages to get a fair value for each process. and so on. There could also be a SIGFREE signal to tell processes they must clean up now or face the OOM killer but that would be secondary for me. I don't ever want to see the OOM killer anyway. MfG Goswin