From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 8898ABBAF for ; Fri, 5 Jun 2009 16:00:07 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtsDAPvBKEqVnFmTgWdsb2JhbACYJQEBFiO4f4QKBQ X-IronPort-AV: E=Sophos;i="4.41,311,1241388000"; d="scan'208";a="30589952" Received: from mail.uj.edu.pl ([149.156.89.147]) by mail1-smtp-roc.national.inria.fr with ESMTP; 05 Jun 2009 16:00:07 +0200 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-2; format=flowed Received: from [127.0.0.1] ([149.156.90.26]) by mail.uj.edu.pl (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPA id <0KKR00E3KQW3CDN0@mail.uj.edu.pl> for caml-list@yquem.inria.fr; Fri, 05 Jun 2009 16:00:04 +0200 (CEST) Message-id: <4A2924E1.50307@wp.pl> Date: Fri, 05 Jun 2009 16:00:01 +0200 From: Dawid Toton User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) To: caml-list@yquem.inria.fr Subject: Memory leak & slowdown X-Spam: no; 0.00; ocaml:01 gtk:01 compaction:01 toplevel:01 threads:01 data:02 allocated:02 library:03 profiling:04 fix:05 exists:05 function:08 useful:09 memory:09 memory:09 I have an OCaml program using GTK running on Windows, using multiple threads. The overall memory usage grows significantly over time, but I don't know why. After it consumes several MB extra, it slows considerably and becomes unusable, so I have to fix this. Is it possible that this is related to GC compaction being turned off? Additional calls to Gc.compact seemingly don't help. The memory usage grows only when the main processing loop is working. After the function exists, the memory is not freed. Moreover, if I start it again, it 'reuses' the leaked memory. The second execution of the loop takes more memory only after it takes more time than the previous one. This made me thinking that it's just some container growing but not shrinking. So I checked my toplevel values with the objsize library, but I managed to trace down only a fraction of the allocated memory and the sizes I get don't grow. How to do memory profiling? The program can have about 10MB of useful data and 200MB of something I don't know. How to check what is this? Dawid