From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id A28E67EE6B for ; Mon, 25 Nov 2013 14:55:28 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMFAIVWk1JbeUeT/2dsb2JhbABZgweEBLkkCoErFnSCJQEBBSNWEAsRBAEBAQICBRMOAgIPBRgdAQUOE4gFrRaQZReBKY1eB4JrNYETA5gTAZISgyk7 X-IPAS-Result: AiMFAIVWk1JbeUeT/2dsb2JhbABZgweEBLkkCoErFnSCJQEBBSNWEAsRBAEBAQICBRMOAgIPBRgdAQUOE4gFrRaQZReBKY1eB4JrNYETA5gTAZISgyk7 X-IronPort-AV: E=Sophos;i="4.93,768,1378850400"; d="scan'208";a="45244643" Received: from nautica.notk.org ([91.121.71.147]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 25 Nov 2013 14:55:28 +0100 Received: by nautica.notk.org (Postfix, from userid 1003) id 1E919C009; Mon, 25 Nov 2013 14:55:27 +0100 (CET) Date: Mon, 25 Nov 2013 14:55:27 +0100 From: Adrien Nader To: Goswin von Brederlow Cc: Amogh Margoor , "caml-list@inria.fr" Message-ID: <20131125135527.GA23794@notk.org> References: <20131120205611.GA15056@notk.org> <20131125130111.GC3610@frosties> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20131125130111.GC3610@frosties> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Ocaml crash in windows due to running out of memory Hi, On Mon, Nov 25, 2013, Goswin von Brederlow wrote: > On Wed, Nov 20, 2013 at 09:56:11PM +0100, Adrien Nader wrote: > > Hi, > > > > On Wed, Nov 20, 2013, Amogh Margoor wrote: > > > Hi, > > > The Ocaml version I am facing problem with is 3.12.1. > > > Regards, > > > Amogh > > > > > > From: Amogh Margoor > > > Sent: Wednesday, November 20, 2013 4:19 PM > > > To: 'caml-list@inria.fr' > > > Subject: Ocaml crash in windows due to running out of memory > > > > > > Hi, > > > We have memory intensive application coded in Ocaml, which crashes on Windows 7 when it runs out of memory instead of throwing an exception. > > > Is that a known issue ? > > > > What is the exception and how much memory is your application using at > > that moment? > > Many kernels only allocate address space on malloc() and assign pages > only on use. They also support over commit of memory. Meaning > applications can allocate more memory than the system has under the > assumption that they won't actually use it all (or that maybe some > memory will be freed before the apps actually use the memory). > > Due to that in many kernels malloc() basically never fails but when > you use the memory and the kernel can't find any page to assign to it > you get a segfault and your program crashes. You only get the > exception if the malloc() fails. > > Now I'm not sure how windows actualy handles this but it sounds like > it allows over commit. As far as I know, it doesn't do overcommit. Also, I doubt that would change anything: if you exhaust your address space, you cannot receive a pointer to some place since it would collide with some of your already assigned space. On 32b, allocations have to fail once you reach 2GB of memory (or 3GB depending on some settings). That said, such a scenario should probably trigger an exception but so far this is just an hypothesis which cannot be confirmed until we roughly know the memory usage. -- Adrien Nader