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 UAA16134; Mon, 7 Apr 2003 20:13:10 +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 UAA16124 for ; Mon, 7 Apr 2003 20:13:03 +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 h37ID1X21496 for ; Mon, 7 Apr 2003 20:13:02 +0200 (MET DST) Received: (qmail 51278 invoked from network); 7 Apr 2003 18:12:59 -0000 Received: from arda.pair.com (HELO compaqreview.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 7 Apr 2003 18:12:59 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030407110109.0376f888@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Mon, 07 Apr 2003 11:08:06 -0800 To: Shivkumar Chandrasekaran , caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] Slow GC problem In-Reply-To: References: <3C821F52-66D5-11D7-A265-000393942C76@ece.ucsb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam: no; 0.00; hecker:01 checker:01 caml-list:01 enquiry:99 malloc:01 allocates:01 bigarrays:01 chunks:01 allocator:01 720:99 doubles:01 allocating:01 ocamlopt:01 arrays:01 chris:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >I am concluding that gc is to blame. Did you profile to check this assumption? What's the profile look like? >Pursuing my earlier enquiry: I noticed that module Bigarray allocated its >arrays using "malloc" rather than on the ocaml heap. My problem allocates >a lot (say 100,000) bigarrays of rather small size (say 30 x 30). Can this >potentially increase the cost of gc? (I have this mental picture of the >ocaml heap fragmented by these immovable malloc'd bigarrays.) The malloc heap should be mostly separate from the caml heap (assuming the malloc heap is allocated in big chunks). If you're really worried about this, write your own bigarray allocator (it's easy) and allocate them yourself out of an already allocated big block of memory. Are you sure you're not paging? 100k 30x30 arrays is 360MB (or 720MB if you're using doubles). Also, if you're constantly allocating and freeing bigarrays you might be more dependent on malloc speed than caml GC speed. Best to post the profile. Use the -p command to ocamlopt, or -ccopt and -cclib commands to use another profiler. You can see examples of gc-bound profiles in the list archive. 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