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 MAA03908; Tue, 8 Apr 2003 12:28:20 +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 MAA03973 for ; Tue, 8 Apr 2003 12:28:19 +0200 (MET DST) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h38ASHX01958 for ; Tue, 8 Apr 2003 12:28:17 +0200 (MET DST) Received: from spi.lip6.fr (IDENT:root@spi.lip6.fr [132.227.83.55]) by isis.lip6.fr (8.12.9/jtpda-5.4+victor) with ESMTP id h38ASFqp031926 ; Tue, 8 Apr 2003 12:28:15 +0200 X-pt: isis.lip6.fr Received: from inria.fr ([132.227.83.193]) by spi.lip6.fr (8.8.7/jtpda-5.2) with ESMTP id MAA01186 ; Tue, 8 Apr 2003 12:28:14 +0200 Date: Tue, 8 Apr 2003 12:28:34 +0200 Subject: Re: [Caml-list] Slow GC problem Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: caml-list@inria.fr To: Shivkumar Chandrasekaran From: Damien Doligez In-Reply-To: Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) X-Scanned-By: isis.lip6.fr X-Spam: no; 0.00; damien:01 caml-list:01 shivkumar:01 enquiry:99 malloc:01 allocates:01 bigarrays:01 chunks:01 interfere:01 allocating:01 re-use:01 arrays:01 bigarray:01 inefficient:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Monday, April 7, 2003, at 07:53 PM, Shivkumar Chandrasekaran wrote: > 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.) Any help will be appreciated. Thanks, It doesn't matter. The ocaml heap is allocated in big chunks from malloc, and other malloc blocks cannot interfere with its fragmentation. If your program is allocating lots of temporary bigarrays and leaves them to be collected by the GC, then I would say it's using bigarrays in an inefficient way. Bigarrays are mostly designed to be long-lived objects. If you can find a way to re-use your bigarrays instead of allocating new ones, you should get better performance. -- Damien ------------------- 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