From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA23566; Mon, 15 Apr 2002 21:38:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA25664 for ; Mon, 15 Apr 2002 21:38:02 +0200 (MET DST) Received: from audi.ibcp.fr (audi.ibcp.fr [193.51.160.127]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g3FJc1v27474 for ; Mon, 15 Apr 2002 21:38:02 +0200 (MET DST) Received: from pc-bioinfo1.ibcp.fr (pc-bioinfo1.ibcp.fr [193.51.160.63]) by audi.ibcp.fr (Postfix) with ESMTP id E8F95FC44 for ; Mon, 15 Apr 2002 21:38:00 +0200 (CEST) Date: Mon, 15 Apr 2002 21:24:15 +0200 (CEST) From: Martin Jambon X-X-Sender: To: Subject: [Caml-list] Memory leak Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, Is it possible that non-negligible amounts of unreachable data are never freed by the GC? My program seems to waste memory, even with Gc.max_overhead set to 50 (or even 0). What should I do? The program is written only in OCaml. It has been tested using version 3.04 and last friday's working version (3.04+9 (2002-04-04)). No dangerous feature of the language is used except Marshal, I think. The program may sequentially handle several gigabytes of marshaled data, but doesn't crash and always produces correct results. Example of Gc.stat (OCaml 3.04): minor_words: 1746668652 promoted_words: 104792423 major_words: 232260045 minor_collections: 121 major_collections: 75727 heap_words: 250683392 (* bytes *) heap_chunks: 941 live_words: 28221788 live_blocks: 4657360 free_words: 34443371 free_blocks: 772158 largest_free: 21914 fragments: 5689 compactions: 11 In this case, the size of the heap should stay below 10 MB. Here, it is 250 MB. Removal of some parts of the program doesn't produce expected results [...]. Comments in module Gc say [about Gc.finalise]: Some constant values can be heap-allocated but never deallocated during the lifetime of the program, for example a list of integer constants; this is also implementation-dependent. How do I know if my program uses such permanent data? Should I use Gc.finalise to look for missing deallocations? Hoping I will get some help... Thanks in advance, Martin ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners