<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thank you for quick response, Dmytro!<br>
I'm afraid you're a bit misled.<br>
<br>
> 2. ProcBins are (iirc) onheap binaries <64 bytes. Each
larger binary stored on heap is a reference counted pointer to
binary heap. Until refcount is >0 the binary remains locked.<br>
According to
<a class="moz-txt-link-freetext" href="http://erlang.org/doc/efficiency_guide/binaryhandling.html">http://erlang.org/doc/efficiency_guide/binaryhandling.html</a>, ProcBin
is a wrapper for globally stored binary while the latter is
refcounted.<br>
Heap binaries (<64 bytes) are different thing and are handled
without ProcBins involved.<br>
<br>
<div class="moz-cite-prefix">On 12/19/2016 03:46 PM, Dmytro
Lytovchenko wrote:<br>
</div>
<blockquote
cite="mid:CAOUb9CEpCDU1jSgaWHOXfvO5iXV4MoRXJG9KayJaQ44EW8zP7A@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">1. When the process is suspended some external
events may happen, such as a kill signal passed to a process.
Its value has to be allocated on the process heap, so it is
possible that GC is invoked.
<div>If i remember right, on heap overflow messages will land in
heap fragments. Next GC will consolidate them into a single
new heap.</div>
<div><br>
<div>2. ProcBins are (iirc) onheap binaries <64 bytes. Each
larger binary stored on heap is a reference counted pointer
to binary heap. Until refcount is >0 the binary remains
locked.</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-12-19 13:29 GMT+01:00 Salikhov
Dinislam <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:Dinislam.Salikhov@kaspersky.com"
target="_blank">Dinislam.Salikhov@kaspersky.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
I've got a couple of questions about garbage collection:<br>
1. AFAIU, a process's heap is garbage collected when the
process is executed. A process creates and destroys new
objects and when there is no enough room for the new object
in the heap, GC is invoked.<br>
When the process is in scheduler's wait queue, then no new
objects are created, so GC isn't called.<br>
The only exception, I see, is when new messages are sent to
suspended process: they are to be kept in receiver's heap
and it may lead to GC invoked.<br>
Is my understanding correct? Or there are other
possibilities to GC suspended process?<br>
<br>
2. In OTP-19.2 sources, erts/emulator/beam/erl_gc.c:sw<wbr>eep_off_heap()
may reallocate ProcBins including the struct binary they
point to. The list of ProcBins to realloc is received in
link_live_proc_bin(). What prevents us to reallocate the
binary that may be referenced by another process?<span
class="HOEnZb"><font color="#888888"><br>
<br>
Salikhov Dinislam<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a moz-do-not-send="true"
href="mailto:erlang-questions@erlang.org"
target="_blank">erlang-questions@erlang.org</a><br>
<a moz-do-not-send="true"
href="http://erlang.org/mailman/listinfo/erlang-questions"
rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
</font></span></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>