caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yang Shouxun <yangsx@fltrp.com>
To: caml-list@inria.fr
Subject: [Caml-list] strange behaviors with output
Date: Mon, 23 Dec 2002 09:11:35 +0800	[thread overview]
Message-ID: <200212230913.10112.yangsx@fltrp.com> (raw)

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


             reply	other threads:[~2002-12-23  1:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-23  1:11 Yang Shouxun [this message]
2002-12-23  2:27 ` Yang Shouxun
2002-12-26 12:45 ` [Caml-list] " Michaël Grünewald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200212230913.10112.yangsx@fltrp.com \
    --to=yangsx@fltrp.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).