Erlang/Windows stabilty - a newbie question.

kaslist kaslist@REDACTED
Sun Mar 26 19:53:46 CEST 2006


Hi,

This is my first post to the the list - I've been coding for about 
twenty-five years... but currently I'm an Erlang newbie :) 

At the moment, I'm having a bit of a problem with program stability 
using Erlang and I wondered if anyone here could help.  I'm using 
R10B-10 on WinXP (2GHz/1GbRAM) and I've narrowed the issue to the 
following code which I've wrapped in a simple module to demonstrate:


-module(testtokens).

-export([start/0]).

start() ->
    erlang:display(time()),
    FILENAME = "test.txt",
    case file:read_file(FILENAME) of
        {ok, Data}    ->
            TESTSTRING = binary_to_list(Data);
        {error, Reason}    ->
            TESTSTRING = ""
    end,

    string:tokens(TESTSTRING, " "),
    time().


The code is intended to load a file, convert it to a string and then 
split the loaded string.  To test Erlang under pressure - I made 
'test.txt' - 14Mb large.  When I run it repeatedly... this is what 
happens...


Erlang (BEAM) emulator version 5.4.13 [threads:0]

Eshell V5.4.13  (abort with ^G)
1> c(testtokens).
./testtokens.erl:11: Warning: variable 'Reason' is unused
{ok,testtokens}
2> testtokens:start().
{19,13,40}
{19,13,50}
3> testtokens:start().
{19,13,55}
{19,14,3}
4> testtokens:start().
{19,14,7}
{19,14,19}
5> testtokens:start().
{19,14,22}
{19,14,50}
6> testtokens:start().
{19,14,53}

Abnormal termination


Every time it crashes.  Thus my question is... am I doing something 
intrinsically dumb/non-erlang here.... or is it a bug?  I know Erlang 
doesn't pretend to be an efficient sequential processor... but I didn't 
expect this.

If you've got any advice I'd really appreciate it.

Thanks,

Kyle.





More information about the erlang-questions mailing list