Hello OTP team,<br><br>I'm writing a memory-bounds feature for my system.   (Erlang is fantastic in this regard -- it's wonderful to be able to examine memory-usage stats for individual or groups of processes, and perhaps force them to garbage-collect or even kill them, causing the minimum transitive restart via supervisors.  I'm using Ulf's gproc library to classify processes by type, and prioritize them, so I can mimimize intrusiveness when choosing which processes to kill.)<br>
<br>Part of this mechanism uses erlang:system_info with the 'large_heap' option -- that's a great facility.<br><br>But I'm really missing a similar facility for detecting runaway creation of binaries.<br><br>
Please would you consider adding a 'large_binaries' option to erlang:system_info?<br>This would send a message if a process allocates more than a total of N bytes of binaries.<br><br>Of course, one issue with that is what does "allocate" mean when multiple processes can have references to the same binary?<br>
<br>As erlang:system_info seems best for coarse-grain alarms, I think it would work fine if the event was triggered when a process was simply holding references to more than N bytes of binary data, even if other processes had references to some of that data.    (The threshold should include the 'buffer' at the end of each binary -- e.g. the Efficiency Guide mentions that most short binaries actually allocate 256 bytes, incase they grow.)<br>
<br>If such a feature is not acceptable/possible, would you consider adding a 'large_total_binaries' option?<br>This would send a message if the total size of all binaries in the VM crossed a threshold.  (I know I can poll for that via erlang:memory(binary), but binaries can be created very rapidly and I don't want to poll at some sub-second interval.)<br>
<br>Many thanks,<br><br>Chris<br><br>(And congratulations on the R13A beta -- it looks fantastic!)<br><br>