<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The app was a web server based on yaws, so most processes were spawned by yaws_server(<0.48.0>), and they were doing the same kind of work:<div><br></div><div>1, parse the http request </div><div>2, request remote server</div><div>3, parse the returned xml</div><div>...</div><div><br></div><div>When the VM crashed, there were about 1,000 this kind of processes but only this one seemed abnormal. Do you mean this process was definitely the one who caused the allocation of <span class="Apple-style-span" style="font-family: Times; ">78362800 </span> bytes' memory. If it's true, it will help me add error locater in the app.</div><div><br></div><div><div><div>ÔÚ 2012-12-13£¬ÏÂÎç5:34£¬ Gustav Simonsson дµÀ£º</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>In the crashdump viewer, you can click on the process that spawned this process (the "Spawned by" field) several times to go up the process hierarchy of your application to see where in the process tree it was spawned. <br>
Also, you can see it was executing a call to xmerl, and is linked to a Erlang port, which should help you narrow down which process it was in your application.<br><br>Cheers,<br>Gustav Simonsson<br><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Dec 13, 2012 at 10:21 AM, cao xu <span dir="ltr"><<a href="mailto:cao.xu@rytong.com" target="_blank">cao.xu@rytong.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div style="word-wrap:break-word">Hi,<div><br></div><div><span style="white-space:pre-wrap"> </span>I got an erlang crash dump file on a 2G memory linux with following info:</div><div><br></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Times;word-spacing:0px">eheap_alloc: Cannot allocate 78362800 bytes of memory (of type "heap").</span></div>
<div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Times;word-spacing:0px"><br>
</span></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Times;word-spacing:0px"><div>
=memory</div><div>total: 1510245164</div><div>processes: 1360838774</div><div>processes_used: 1360720438</div></span></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Times;word-spacing:0px"><br>
</span></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Times;word-spacing:0px"><span style="white-space:pre-wrap"> </span></span>The total memory consumed by the VM was about 1.5G and most of them were used by process. According to the process info in the dump file, the biggest Stack+Heap was <span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-right;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Times;word-spacing:0px">15672560 </span>and the owner's state was garbing. I am not sure whether the process was the killer of the whole VM. </div>
<div><br></div><div><table style="font-family:Times;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px" border="4" cols="4" width="100%"><tbody><tr><td nowrap=""><b>Name</b></td><td colspan="1"> </td>
<td nowrap=""><b>Spawned as</b></td><td colspan="1">proc_lib:init_p/5</td></tr><tr><td nowrap=""><b>State</b></td><td colspan="1">Garbing (limited info)</td><td nowrap=""><b>Last scheduled in for</b></td><td colspan="1">xmerl_scan:'-initial_state0/2-fun-1-'/2</td>
</tr><tr><td nowrap=""><b>Started</b></td><td colspan="1">Tue Nov 6 17:00:39 2012</td><td nowrap=""><b>Spawned by</b></td><td colspan="1"><a href="http://localhost:8888/cdv_erl/crashdump_viewer/proc_details?pid=%3C0.48.0%3E" target="_blank"><0.48.0></a></td>
</tr><tr><td nowrap=""><b>Reductions</b></td><td colspan="3">20600887</td></tr><tr><td nowrap=""><b>Stack+heap</b></td><td>15672560</td><td nowrap=""><b>OldHeap</b></td><td>8024355</td></tr><tr><td nowrap=""><b>Heap unused</b></td><td>
202</td><td nowrap=""><b>OldHeap unused</b></td><td>8024355</td></tr><tr><td nowrap=""><b>Number of heap fragments</b></td><td>1</td><td nowrap=""><b>Heap fragment data</b></td><td>119</td></tr><tr><td nowrap=""><b>Program counter</b></td>
<td colspan="3">0x02ea24dc (xmerl_scan:'-initial_state0/2-fun-1-'/2 + 4)</td></tr><tr><td nowrap=""><b>Continuation pointer</b></td><td colspan="3">0x02e8a254 (xmerl_scan:scan_char_data/5 + 2408)</td></tr><tr><td nowrap="">
<b>Arity</b></td><td colspan="3"> </td></tr><tr><td nowrap=""><b>Link list</b></td><td colspan="3">[<a href="http://localhost:8888/cdv_erl/crashdump_viewer/port?port=Port%3C0.16239279%3E" target="_blank">#Port<0.16239279></a>, <a href="http://localhost:8888/cdv_erl/crashdump_viewer/proc_details?pid=%3C0.48.0%3E" target="_blank"><0.48.0></a>]</td>
</tr><tr><td nowrap=""><b>Msg queue length</b></td><td colspan="3">0</td></tr></tbody></table><div><br></div></div><div><br></div><div>Is there a way to find out which process or function call was the reason of the allocating action, and how can I get more info from the dump file to help locating the error?</div>
<div><br></div><div>Thanks.</div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></body></html>