From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3KIWvhd004705 for ; Fri, 20 Apr 2012 20:32:57 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUCALGqkU/RVdW2kGdsb2JhbABEn1yIWgGIeQgiAQEBAQkJDQcUBCOCCQEBAQMBEgIsARsSDAMBCwYFBAcaISIBEQEFAQoSKxCHXgEDBgULnAUKjCKCc4UqChknAwpXiHYBBQuNN4MlBIhdhTKHaoERjUw9hA8 X-IronPort-AV: E=Sophos;i="4.75,454,1330902000"; d="scan'208";a="140980729" Received: from mail-yx0-f182.google.com ([209.85.213.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Apr 2012 20:32:51 +0200 Received: by yenl9 with SMTP id l9so7860623yen.27 for ; Fri, 20 Apr 2012 11:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=74kYwZ1Kq69KgzVfcQqHsBq/Na3v15PsqcuM5ay9AKo=; b=0l7ugTH2ZKMEj8Xq+qk+4ovUhE0y0RQN4a1I7VpPZjrDqdRL/tBxUEqzAq2B+WcqG9 C86inZVwm9uiUectqSCjtkMKlnAWuiy8vEn6mGsyGeRm9P4BwLRUudJE5KadgqXZxNoR K+ScjzIfLIJXrO5gP5FSDHmuJ4Jo2Xd+/BBtt3xAAO0377m9PC/wSODyhQ+ESgrtHosX DEYxcRgtXCe3sHxBCxYxJ+zjkoe1fbr/CJeoJIOyKufMEjV/YNFHCJ52bifN6tZSKr0L Xqu26WtWYLyLktnR5/iKZa40BDxfx9HG8SragbPXadY6svIvL7XER8Qca7DDbId/x5WY v9UA== MIME-Version: 1.0 Received: by 10.236.79.195 with SMTP id i43mr6881593yhe.53.1334946770789; Fri, 20 Apr 2012 11:32:50 -0700 (PDT) Received: by 10.236.145.36 with HTTP; Fri, 20 Apr 2012 11:32:50 -0700 (PDT) In-Reply-To: <4F9191D5.6060809@etorok.net> References: <4F9191D5.6060809@etorok.net> Date: Fri, 20 Apr 2012 22:32:50 +0400 Message-ID: From: SerP To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=bcaec5396dfe11287f04be208482 Subject: Re: [Caml-list] Memory fragmentation --bcaec5396dfe11287f04be208482 Content-Type: text/plain; charset=ISO-8859-1 > > If that is the case then maybe it would help to try and allocate memory in > the OCaml's runtime by using mmap() directly. > Yes, i need to try this. > > Is your application completely single-threaded (since you're using lwt), > or do you also use multiple threads? > I think that glibc caches mmap-ed areas even if you free them (i.e. > they're still mapped into your process but they might be changed via > mprotect() to PROT_NONE), which is especially a problem if you use multiple > threads. > Lwt use threads for some bloking system calls, so my application has multiple threads. Strange behaviour is that the before (first|second) compaction all ocaml memory (1GB) was in mmaped area, but after all ocaml memory in placed in brked memory and later all allocations occurs throught brk. major_heap - is 2MB > Best regards, > --Edwin > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > --bcaec5396dfe11287f04be208482 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
If that is the ca= se then maybe it would help=A0to try and allocate memory in the OCaml's= runtime by using mmap() directly.
Yes, i need to try this.=A0

Is your application completely single-threaded (since you're using = lwt), or do you also use multiple threads?
I think that glibc caches mma= p-ed areas even if you free them (i.e. they're still mapped into your p= rocess=A0but they might be changed via mprotect() to PROT_NONE), which is e= specially a problem if you use multiple threads.
Lwt use threads for some bloking system calls, so my appl= ication has multiple threads.

Strange behaviour is= that the before (first|second) compaction all ocaml memory (1GB) was in mm= aped area, but after all ocaml memory in placed in brked memory and later a= ll allocations occurs throught brk. major_heap - is 2MB=A0
=A0=A0
Best regards,
--Edwin

--
Caml-list mailing list. =A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


--bcaec5396dfe11287f04be208482--