<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;
        mso-fareast-language:ZH-CN;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I just briefly read your post so I might have missed something, but here’s some comments.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It looks like you’re sending really large messages, I can’t read from your mail how large, but 19489 times 200 bytes (just an example) would be 2Mb.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">That is rather unusual.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Could you test making the tail call a full module call:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">        {From, Data} -><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">            From ! Data,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">            test4:loop()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Just to check if that have any influence on GC.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The other thing is that you should be careful to empty the process “mailbox” by using an other-clause in receive:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">    receive<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">        {From, Data} -><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">            From ! Data,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">            loop()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">        Other -><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">             exit({got_unhandled_message, Other}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">    end.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I’d suggest to use a gen_server so you don’t need to bother too much.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">/Ola<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> erlang-questions-bounces@erlang.org [mailto:erlang-questions-bounces@erlang.org]
<b>On Behalf Of </b>???<br>
<b>Sent:</b> den 15 januari 2014 08:18<br>
<b>To:</b> Erlang (E-mail)<br>
<b>Subject:</b> Re: [erlang-questions] Need help understanding why the Process(Pid) consumers a lot of memory and did not garbage collect<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I will appreciate If  anyone  can reply to me .<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2014/1/14 <span lang="ZH-CN">郎咸武</span> <<a href="mailto:langxianzhe@gmail.com" target="_blank">langxianzhe@gmail.com</a>><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Hi All.</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">In recently, I ran into a problem which the Process consumers a lot of memory. There is roughly from 300M to 450 each process.</span><span lang="ZH-CN" style="font-size:11.0pt">。</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">The memory will be free if invoke erlang:garbage_collect/1</span><span lang="ZH-CN" style="font-size:11.0pt">。</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">So,
 In my view , the moemry may is not be used, and do not garbage collect. Why? I can not get it. Please give some for me. </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">For further resolve the problem,  I do some test in the simplification program. The memery is can garbage collect too(pass an hour).</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Test Method</span><span lang="ZH-CN" style="font-size:11.0pt">:</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">1</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">The R variable is about 19489 number records<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="ZH-CN" style="font-size:11.0pt">(如</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"},{"timestamp","2013-07-17 10:47:36"},{"time_int",63541277256},{"title",[233,155,133,229,133,184,231,139,172,229,136,155,232,136,170,230,181,183,229,164,169,230,150,135,229,143,176,232,133,149,232,161,168]},{"id","info-137429256786232"}]</span><span lang="ZH-CN" style="font-size:11.0pt">)</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">2</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Obtain the Process of Pid<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">      (<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)5> Pid = test4:get_pid()<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">3</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">The Pid state before send R data<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)7> erlang:process_info(Pid, memory).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">{memory,2656}</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)8> erlang:process_info(Pid).        <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">[{current_function,{test4,loop,0}},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {initial_call,{test4,loop,0}},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {status,waiting},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {message_queue_len,0},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {messages,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {links,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {dictionary,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {trap_exit,false},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {error_handler,error_handler},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {priority,normal},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {group_leader,<0.31.0>},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {total_heap_size,233},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {heap_size,233},</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {stack_size,1},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {reductions,1},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {garbage_collection,[{min_bin_vheap_size,46368},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {min_heap_size,233},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {fullsweep_after,0},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {minor_gcs,0}]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {suspending,[]}]<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">4</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> to send  R Data<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)9> Pid ! {self(),R}<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)9> .<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">{<0.52.0>,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {ok,[{1,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">       [[{"author_id","users-a9KsYTIRdrq3iuAywiLRE2BGd3Y"},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">         {"timestamp","2013-07-17 10......................<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">5</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">The Pid state after  send R data, The memory is
 increasing.<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)11> erlang:process_info(Pid, memory).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">{memory,51356672}</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)12> erlang:process_info(Pid).        <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">[{current_function,{test4,loop,0}},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {initial_call,{test4,loop,0}},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {status,waiting},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {message_queue_len,0},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {messages,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {links,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {dictionary,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {trap_exit,false},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {error_handler,error_handler},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {priority,normal},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {group_leader,<0.31.0>},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {total_heap_size,6419485},</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {heap_size,6419485},</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {stack_size,1},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {reductions,2002},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {garbage_collection,[{min_bin_vheap_size,46368},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {min_heap_size,233},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {fullsweep_after,0},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {minor_gcs,0}]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {suspending,[]}]<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">6</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">to send R data again.<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)13> Pid ! {self(),R}.                <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">{<0.52.0>,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {ok,[{1,<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">7</span><span lang="ZH-CN" style="font-size:11.0pt">、</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">The memory  continue to increas.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)14> erlang:process_info(Pid, memory).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">{memory,125381272}</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)15> erlang:process_info(Pid).        <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">[{current_function,{test4,loop,0}},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {initial_call,{test4,loop,0}},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {status,waiting},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {message_queue_len,0},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {messages,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {links,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {dictionary,[]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {trap_exit,false},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {error_handler,error_handler},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {priority,normal},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {group_leader,<0.31.0>},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {total_heap_size,15672560},</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {heap_size,15672560},</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {stack_size,1},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {reductions,4003},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {garbage_collection,[{min_bin_vheap_size,46368},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {min_heap_size,233},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {fullsweep_after,0},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">                      {minor_gcs,0}]},<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> {suspending,[]}]<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">I am  </span></b><span style="font-size:10.5pt;font-family:"Helvetica","sans-serif"">wondering the cause why  it is can not collect, Please give me some idea. </span><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Thanks
 a lot.</span></b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">(<a href="mailto:trends1@192.168.16.50" target="_blank">trends1@192.168.16.50</a>)23> erlang:process_info(Pid, memory).<o:p></o:p></span></b></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">{memory,195907792}<o:p></o:p></span></b></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></b></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Helvetica","sans-serif"">I'm running </span><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Erlang R14B04 on the unbuntu.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]</span><span lang="ZH-CN" style="font-size:11.0pt">和</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Linux jason-lxw 3.2.0-55-generic #85-Ubuntu SMP Wed Oct 2 12:29:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux<br clear="all">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">[1]</span><span lang="ZH-CN" style="font-size:11.0pt">代码:</span><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  1 -module(test4).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  2 -export([get_pid/0,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  3          get_data/1,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  4          get_pids/1,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  5          loop/0]).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  6 <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  7 get_pids(L) -><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  8     get_pids(0, L).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">  9 <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 10 get_pids(0, L) -><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 11     L;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 12 get_pids(N, R) -><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 13     NewR = [get_pid()|R],<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 14     get_pids(N-1, NewR).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 15 <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 16 get_pid()-><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 17      spawn_opt(?MODULE, loop, [], [{fullsweep_after,0}]).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 18      %spawn(?MODULE, loop, []).                                                                                                                   <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 19 <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 20 get_data(Pid) -><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 21      Pid ! {self(), get}.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 22 <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 23 loop() -><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 24     receive<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 25         {From, Data} -><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 26             From ! Data,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 27             loop()<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""> 28     end.<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Jason <o:p></o:p></p>
</div>
<p class="MsoNormal"><span class="hoenzb"><span style="color:#888888">-- </span></span><span style="color:#888888"><br>
<span class="hoenzb"><span lang="ZH-CN">只为成功找方法,不为失败找理由 </span></span></span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <br>
<span lang="ZH-CN">只为成功找方法,不为失败找理由 </span><o:p></o:p></p>
</div>
</div>
</body>
</html>