-module(jtoy). -compile(export_all). %%% Still runs like a dog... start() -> start("big.txt"). start(File) -> spawn_opt(fun() -> go(File) end, [{min_heap_size, 80000000}, {fullsweep_after, 10000}]). go(File) -> io:format("A ~p~n", [time()]), {ok,B} = file:read_file(File), io:format("B ~p~n", [time()]), Len = length([Tok || {Tok,_} <- re:mallg(binary_to_list(B), re:parse("[a-zA-Z]+"))]), io:format("Len = ~p~n", [Len]), io:format("C ~p~n", [time()]).