[erlang-questions] Too many processes

Mazen Harake mazen.harake@REDACTED
Thu Apr 23 13:39:56 CEST 2009


Try http://www.erlang.org/doc/man/erl.html
Check out Emulator Flags (+P...)
maybe that helps,

cheers,
/Mazen




http://www.erlang-consulting.com
http://www.erlang-factory.com/

marmll wrote:
> Hi, 
>
> i have the following problem:
>
> My error_logger tells me that I’am having “Too many processes” and the
> erlang engine crashed. 
> When I’am starting the gen_server I’am checking the
> erlang:system_info(process_count) and they tells me 80 processes.
>
> Codesnip from init:
>     F = fun(Sock) -> parse_packet(Sock, Client) end,
>     tcp_server:stop(Port),
>     {ok, _} = tcp_server:start_raw_server(Port, F, 10240,2048),
>
> And here my parse_packet:
>
> parse_packet(Socket, Client) ->
>     receive
>                 {tcp, Socket, Bin} ->
>                     io:format("--> ~w~n", [Bin]);
>                 {tcp_closed, Socket} ->
>                     error_logger:error_report([{module, ?MODULE},{line,
> ?LINE},{message, "tcpclosed"},{call, "tcp_closed aus
> receive"},{now,now()}]);
>                 {packet, Packet} ->
>                     io:format("<-- ~w~n", [Packet]),
>                     parse_packet(Socket, Client)
> end.
>
> With every connect to the server my process_count is increasing 1 ! 
>
> How can I handle the process_count ? I think the the tail recursion at
> parse_packet is not good. 
>
> Please help me 
> Thanks 
>
>   




More information about the erlang-questions mailing list