[erlang-questions] driver_alloc high usage

Max Lapshin max.lapshin@REDACTED
Thu Nov 12 08:04:08 CET 2015


And as far as I understand leak is somewhere in driver code, not c library.

Btw, maybe it is possible to pass some port id to driver_alloc for
measuring, what instance is leaking?

Driver_alloc(size, port_instance_id)


On Thursday, November 12, 2015, Lukas Larsson <garazdawi@REDACTED> wrote:

> Since it is instance 0, it will most likely be someone that does not run
> in a scheduler thread. eg async thread or nif thread.
>
> On Wed, Nov 11, 2015 at 7:55 PM, Max Lapshin <max.lapshin@REDACTED
> <javascript:_e(%7B%7D,'cvml','max.lapshin@REDACTED');>> wrote:
>
>> Just for a reminder:
>>
>> [case A of {driver_alloc,_} -> Calls = proplists:get_value(calls,I),
>> {_,_,M} = lists:keyfind(driver_alloc,1,Calls),{_,_,F} =
>> lists:keyfind(driver_free,1,Calls), io:format("~p ~p\n", [A, M-F]); _ -> ok
>> end|| {A,I} <- recon_alloc:allocators()].
>>
>>
>> shows something like:
>>
>>
>> {driver_alloc,0} 125581808
>>
>> {driver_alloc,1} 313
>>
>> {driver_alloc,2} 280
>>
>> {driver_alloc,3} 131
>>
>> {driver_alloc,4} -52
>>
>> {driver_alloc,5} -152
>>
>> ...
>>
>>
>>
>> Now need only to find out, who is mallocing without free
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151112/f13674bb/attachment.htm>


More information about the erlang-questions mailing list