From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id A455BBBAF for ; Wed, 24 Nov 2010 08:31:13 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUBAHxO7EzRVaE0kGdsb2JhbACibAgWAQIJCRMRAx+ibYlkghiFGS6IWQEBAwWFRwSOVIcm X-IronPort-AV: E=Sophos;i="4.59,246,1288566000"; d="scan'208";a="80088770" Received: from mail-fx0-f52.google.com ([209.85.161.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 24 Nov 2010 08:30:39 +0100 Received: by fxm5 with SMTP id 5so269526fxm.39 for ; Tue, 23 Nov 2010 23:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=i5uYN5MWeuvts03EHORraNxG2xmajvWQMw1VkaQNRGA=; b=lunbZ9d7xJ7s4rPw6bihQJnzvCZXaoMNTcdkht/eaN1suDurV8fzGFHG5IqlWrikrt HjBmL/+w7XZY94KJE+Jw8fnybbGcV5wVAjrToGMeAQhKAtmTvhiRUwJ4lTg7mXOBmKNg PkVBbb+W/rDxFv2Ka9xjza143yxGVliTdaVeE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=AwyuT/LcraRzXbMVUQj8hvzUmJo+9C5lOq3XE49WTdw0I5ZjEeSVX1ms9Unt9hpquN drSILL4eocCK2GC/odhQpqwfh1/N1cuK/fK/MQtiXkgex/TOeQjt0882YK2zmImptJPG pmMS8yovYWXRxHYexNWLaJA5RPHgHO8MLsD+I= Received: by 10.223.103.12 with SMTP id i12mr5712922fao.43.1290583838462; Tue, 23 Nov 2010 23:30:38 -0800 (PST) Received: from deb0 ([79.114.61.205]) by mx.google.com with ESMTPS id n3sm2078631faa.5.2010.11.23.23.30.37 (version=SSLv3 cipher=RC4-MD5); Tue, 23 Nov 2010 23:30:38 -0800 (PST) Date: Wed, 24 Nov 2010 09:30:35 +0200 From: =?UTF-8?B?VMO2csO2aw==?= Edwin To: "Kecheng" Cc: "caml-list" Subject: Re: [Caml-list] OCaml memory leak issue Message-ID: <20101124093035.473bd2e5@deb0> In-Reply-To: <201011231954241577004@cecs.pdx.edu> References: <201011231954241577004@cecs.pdx.edu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 byte:01 printf:01 edwin:98 wrote:01 caml-list:01 explicitly:02 let:03 let:03 exit:04 confused:04 problem:05 tue:06 pdx:08 On Tue, 23 Nov 2010 19:54:24 -0800 "Kecheng" wrote: > Hi, > > I used valgrind to check the memory usage of my OCaml byte code, but > I found that a memory leak. I'm very confused what the problem is. I > tried a very simple code as following, and compileed it. > > +++++++++++++++++++++++ > let test = > let a = 1 in > let b = a + 5 in > printf "%d\n" b; > ;; > test;; > +++++++++++++++++++++++ I think you need to call the GC on exit explicitly, its not done by default. Best regards, --Edwin