<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Yes, this is the solution. Thx!</div><br><div><div>On 23 nov. 2012, at 10:10, Slava Yurin <<a href="mailto:YurinVV@yandex.ru">YurinVV@yandex.ru</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi, Ward. </div><div> </div><div>Because erlang shell save history for you. Garbage collect not affect to constructed binary.</div><div> </div><div>try:</div><div>spawn(fun() -> lists:foldl(fun(_I, Acc) -> <<Acc/binary, Acc/binary>> end, <<"abc">>, lists:seq(0,21)) end).</div><div> </div><div>And you will see that no such big increase in binary heap.</div><div> </div><div>23.11.2012, 15:57, "Ward Bekker (TTY)" <<a href="mailto:ward@tty.nl">ward@tty.nl</a>>:</div><blockquote type="cite">Hi,<div>After an operation with binaries, and manual requesting a garbage collect, the binary heap does not shrink to it's former size. See my test sequence below. About 1.5 MB is added to the binary heap, and never garbage collected. What can be the cause?</div><div>/W</div><div>=========<br><div>Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]<br><br>Eshell V5.9.2  (abort with ^G)<br>1> <strong>erlang:memory().</strong><br>[{total,<span>9654968</span>},<br> {processes,<span>1123090</span>},<br> {processes_used,<span>1123090</span>},<br> {system,<span>8531878</span>},<br> {atom,194289},<br> {atom_used,176885},<br> {binary,<span>1319320</span>},<br> {code,<span>3892513</span>},<br> {ets,298400}]</div><div><br>2> <strong>lists:foldl(fun(_I, Acc) -> <<Acc/binary, Acc/binary>> end, <<"abc">>, lists:seq(0,21)).</strong><br><<"abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcab">></div><div><br>3> <strong>erlang:memory().</strong><br>[{total,<span>22340920</span>},<br> {processes,<span>1127984</span>},<br> {processes_used,<span>1127970</span>},<br> {system,<span>21212936</span>},<br> {atom,202481},<br> {atom_used,186083},<br> {binary,<span>13901920</span>},<br> {code,<span>3972848</span>},<br> {ets,302504}]</div><div><br>4> <strong>erlang:garbage_collect().</strong><br>true</div><div><br>5> <strong>erlang:memory().</strong><br>[{total,<span>22314232</span>},<br> {processes,<span>1100552</span>},<br> {processes_used,<span>1100538</span>},<br> {system,<span>21213680</span>},<br> {atom,202481},<br> {atom_used,186083},<br> {binary,<span>13902664</span>},<br> {code,<span>3972848</span>},<br> {ets,302504}]<br>6> </div></div>,<p>_______________________________________________<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">http://erlang.org/mailman/listinfo/erlang-questions</a></p></blockquote></blockquote></div><br></body></html>