change heap size

This commit is contained in:
hejin 2014-12-02 22:53:29 +08:00
parent c12a0b236e
commit 109e98d80c
1 changed files with 3 additions and 5 deletions

View File

@ -25,7 +25,7 @@ start_link() ->
%% Description: Initiates the server %% Description: Initiates the server
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
init([]) -> init([]) ->
erlang:system_monitor(self(), [{long_gc, 5000}, {large_heap, 10000}, busy_port]), erlang:system_monitor(self(), [{long_gc, 5000}, {large_heap, 1000000}, busy_port]),
?INFO("monitor is started...[ok]", []), ?INFO("monitor is started...[ok]", []),
{ok, #state{}}. {ok, #state{}}.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
@ -61,10 +61,8 @@ handle_info({monitor, GcPid, long_gc, Info}, State) ->
{noreply, State}; {noreply, State};
handle_info({monitor, GcPid, large_heap, Info}, State) -> handle_info({monitor, GcPid, large_heap, Info}, State) ->
[{messages,Mess}] = process_info(GcPid, [messages]), ?ERROR("large_heap: gcpid = ~p,~p ~n ~p", [GcPid, process_info(GcPid,
?ERROR("large_heap: gcpid = ~p,~p ~n ~p, ~p", [GcPid, process_info(GcPid, [registered_name, memory, message_queue_len,heap_size,total_heap_size]), Info]),
[registered_name, memory, message_queue_len,heap_size,total_heap_size]),
lists:nth(1, Mess),Info]),
{noreply, State}; {noreply, State};
handle_info({monitor, SusPid, busy_port, Port}, State) -> handle_info({monitor, SusPid, busy_port, Port}, State) ->