Cry<span></span>stal clear. Thank you Tony. <div><br></div><div>Frank.<br><br>Le Friday, October 28, 2016, Tony Rogvall <<a href="mailto:tony@rogvall.se">tony@rogvall.se</a>> a écrit :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On 28 okt 2016, at 06:08, Frank Muller <<a href="javascript:;" onclick="_e(event, 'cvml', 'frank.muller.erl@gmail.com')">frank.muller.erl@gmail.com</a>> wrote:<br>
><br>
> Hmmm ... bigger to lower the overhead ratio, right?<br>
><br>
Yes. The overhead is fixed.<br>
<br>
> Question: is there any (6-words) overhead if a process send 512-bytes Bin message to another one?<br>
><br>
Yes.<br>
<br>
Every process keeps a list of ProcBins. This structure is kept in order to reference count the (global) binary objects.<br>
After a garbage collection of the heap, that list is swept and binary objects not found by the garbage collection are<br>
dereferenced and the ProcBin is then removed.<br>
References to the same ProcBin in Erlang code will not create an other ProcBin,<br>
( the expression Bin2 = Bin1 just copy the reference to the ProcBin )<br>
<br>
/Tony<br>
<br>
> Frank.<br>
><br>
> Le Friday, October 28, 2016, Tony Rogvall <<a href="javascript:;" onclick="_e(event, 'cvml', 'tony@rogvall.se')">tony@rogvall.se</a>> a écrit :<br>
> Simple, you may your 512 byte memory chunks bigger :-)<br>
><br>
> /Tony<br>
><br>
> > On 27 okt 2016, at 23:24, Frank Muller <<a href="javascript:;" onclick="_e(event, 'cvml', 'frank.muller.erl@gmail.com')">frank.muller.erl@gmail.com</a>> wrote:<br>
> ><br>
> > Tony,<br>
> ><br>
> > Wow, 48-bytes is a huge overhead as N ~= 1000, and Every reader reads a binary 10x times or so per second.<br>
> ><br>
> > Can anyone please suggest a better strategy to efficiently share them with a lesser overhead?<br>
> ><br>
> > Frank.<br>
> ><br>
> > Le Thursday, October 27, 2016, Tony Rogvall <<a href="javascript:;" onclick="_e(event, 'cvml', 'tony@rogvall.se')">tony@rogvall.se</a>> a écrit :<br>
> > 1. A reference.<br>
> ><br>
> > It will however build a 6-word structure called ProcBin on the heap for every binary reference that you read.<br>
> > On a 64 bit machine that will lead to a 48 byte overhead. Nearly 10%.<br>
> ><br>
> > /Tony<br>
> ><br>
> > > On 27 okt 2016, at 20:47, Frank Muller <<a href="javascript:;" onclick="_e(event, 'cvml', 'frank.muller.erl@gmail.com')">frank.muller.erl@gmail.com</a>> wrote:<br>
> > ><br>
> > > Hi guys<br>
> > ><br>
> > > Suppose an ETS table with only 1 writer and N readers<br>
> > > This table contains only large binaries (>64B) with the same size 512B exactly.<br>
> > ><br>
> > > The single writer update these Bins once a while.<br>
> > > The N readers regularly read one of these Bins, but never change/update them.<br>
> > ><br>
> > > Questions: what a reader gets when reading a Bin from this ETS table:<br>
> > ><br>
> > > 1. a reference to that Bin<br>
> > > 2. or a full copy of that Bin<br>
> > ><br>
> > > Hope someone can clarify this (with an example).<br>
> > ><br>
> > > Thank you<br>
> > > Frank<br>
> > ><br>
> > > ______________________________<wbr>_________________<br>
> > > erlang-questions mailing list<br>
> > > <a href="javascript:;" onclick="_e(event, 'cvml', '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/<wbr>listinfo/erlang-questions</a><br>
> ><br>
><br>
<br>
</blockquote></div>