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 JAA31332; Thu, 24 Apr 2003 09:47:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA31246 for ; Thu, 24 Apr 2003 09:47:04 +0200 (MET DST) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h3O7l3H00911 for ; Thu, 24 Apr 2003 09:47:03 +0200 (MET DST) Received: (qmail 17048 invoked from network); 24 Apr 2003 07:47:02 -0000 Received: from arda.pair.com (HELO compaqreview.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 24 Apr 2003 07:47:02 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030424001900.037a2958@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 24 Apr 2003 00:41:14 -0700 To: caml-list@inria.fr, caml-bugs@pauillac.inria.fr From: Chris Hecker Subject: [Caml-list] Str memory leak in 3.06? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam: no; 0.00; hecker:01 checker:01 3.06:01 ocamlopt:01 foo:01 inserting:01 slows:01 debugger:01 glance:01 finalizer:01 grovel:01 regex:01 bug:01 601:99 alloc:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This program leaks 10mb/sec on my machine with ocamlopt 3.06 (msvc, xp). let _ = while true do let re = Str.regexp "foo" in () done; () Inserting a call to Gc.compact in the loop doesn't affect it (well, it slows the loop down a bit so the leak rate drops :). From a brief trip in the debugger and a glance at strstubs.cpp it appears the custom finalizer is being called. I didn't grovel in the actual regex code to see where the leak was (assuming it's not my bug and I'm supposed to free the regex somehow in caml code). I also notice that the strstubs.c has the same problem I reported in bigarray (and that was fixed, bug #601) about using stat_alloc() to allocate but free() to deallocate, so it should probably be fixed here as well, assuming Str is going to live much longer. Chris ------------------- 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