From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p199T3pq015766 for ; Wed, 9 Feb 2011 10:29:03 +0100 X-IronPort-AV: E=Sophos;i="4.60,446,1291590000"; d="scan'208";a="99545405" Received: from mp-57040.rocqadm.inria.fr ([128.93.57.40]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 09 Feb 2011 10:28:58 +0100 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=iso-8859-1 From: xclerc In-Reply-To: Date: Wed, 9 Feb 2011 10:28:56 +0100 Cc: xclerc Clerc Message-Id: References: To: Caml List X-Mailer: Apple Mail (2.1082) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p199T3pq015766 Subject: Re: [Caml-list] Structural avoidance of memory leaks? Le 9 févr. 2011 à 09:47, David MENTRE a écrit : > Hello Mr. Garrigue, > > 2011/2/9 Jacques Garrigue : >> * Memory leaks: have to be careful that you are not referencing dead data, preventing the GC from freeing it. > > I thought for a long time that having a GC would avoid any memory > leak. It appears that this is not the case. Java programmers are well > aware of the issue and apparently Haskell and OCaml programmers also. The Java literature about this problem is in fact quite abundant. One reason for this being that Java is widely used for server-side applications that have a very long lifetime (think webserver, and the like). This is why J2EE developer are particularly aware of the problem. I would add that a related problem to some leaks in these systems is security (e. g. keeping passwords or other sensitive information in memory longer than needed).This is probably a problem some OCaml developer face, maybe Ocsigen developers and/or users. Finally, if you read some Java papers that refers to the "jconsole" tool to discover such leaks, the closest OCaml equivalent I can think of is ocamlviz: http://ocamlviz.forge.ocamlcore.org/ Hope this helps, Xavier Clerc