Since pcap handle only gets closed when program exits, memory consumption is constantly growing. It is particularly noticeable when find3-cli-scanner is executed with --forewer. In my tests memory usage grows from 18-20 MB to 90-105 MB in 10 minutes.
This commit attempts to prevent this by closing pcap handle on scanSeconds, thus freeing up memory.
pprof top output after 10 minutes of runtime in passive mode (before):
Since pcap handle only gets closed when program exits, memory consumption is constantly growing. It is particularly noticeable when
find3-cli-scanner
is executed with--forewer
. In my tests memory usage grows from18-20 MB
to90-105 MB
in 10 minutes.This commit attempts to prevent this by closing pcap handle on
scanSeconds
, thus freeing up memory.pprof top output after 10 minutes of runtime in passive mode (before):
pprof top output after 10 minutes of runtime in passive mode (after):