Question about TCP connection and drv_binary memory allocation

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Question about TCP connection and drv_binary memory allocation

Hi erlang experts,

I did a testing about tcp connection.
The scenario is simple:
1) start two erlang nodes (let us say "node C" and "node S") with flag "+Mim true" to enable the instrument;
2) on "node S" I start a TCP server which accepts connections;
3) on "node C" I spawn 10000 processes to connect to "node S"; all the connections were successful;
4) I use instrument to lookat the "drv_binary" and "binary" memory status, I found on "node S", there was a 419461 bytes drv_binary item
   corresponded to per TCP connection; but there was NOT a same drv_binary item on "node C".   The total memory usage on "node S"
  is 419461 * 10000, about 4G, too huge.

 My question is: who allocated the 419461 drv_binary memory?

This is the tcp options on "node S" I used:

-define(TCP_OPTS, [


    {backlog, 256},

    {packet, 0},

    {active, false},

    {reuseaddr, true},

    {nodelay, false},

    {delay_send, true},

    {keepalive, true},

    {send_timeout, 60000},

    {exit_on_close, true}


This is the memory status that I use instrument:memory_data/0 and  instrument:descr/1 to lookat:
[ .......

Thanks very much.


erlang-questions mailing list
[hidden email]