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 CAA23665; Mon, 23 Dec 2002 02:16:51 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA23452 for ; Mon, 23 Dec 2002 02:16:47 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mail.fltrp.com ([211.101.185.130]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gBN1Gin06286 for ; Mon, 23 Dec 2002 02:16:45 +0100 (MET) Received: from delbian [129.0.5.6] by mail.fltrp.com with ESMTP (SMTPD32-7.13) id A27422F0122; Mon, 23 Dec 2002 09:10:12 +0800 Content-Type: text/plain; charset="us-ascii" From: Yang Shouxun Organization: FLTRP To: caml-list@inria.fr Subject: [Caml-list] strange behaviors with output Date: Mon, 23 Dec 2002 09:11:35 +0800 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200212230913.10112.yangsx@fltrp.com> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I found a strange behavior when compiling and running a simple ocaml program. When the file to process (a testing case) is small, it works as expected. But when the file (the real case) is very large, it does not. For instance, if the expected output should be: ----8<---- a b c d ... ----8<---- What I get may be: ----8<---- a d c b ... ----8<---- That is to say, when the input file is large, every now and then the output sequences of lines will be reversed. Another point is that the program consumes a lot of memory, so much so that when the input file is very big the progam gets killed by the OS. Actually the program should consume very small memory. What I'm trying to do is: ----8<---- initialize result read one line from the input file comparing it to the last line if test condition true update result read next line else print the result and flush stdout ----8<---- I'm using ocaml on Debian. It's the latest from sid. Any ideas? TIA! shouxun ------------------- 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