DNSCrypt / dnscrypt-proxy

dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.
https://dnscrypt.info
ISC License
11.31k stars 1.01k forks source link

High memory usage on asuswrt router #461

Closed alphabt closed 6 years ago

alphabt commented 6 years ago

I installed dnscrypt-proxy into my asuswrt-merlin router using https://github.com/thuantran/dnscrypt-asuswrt-installer. I checked the memory usage via top and if I understand VSZs column correctly it's using 778mb of memory at 331.3%, not sure how this is possible since the router only has 256mb. I did setup swap file using the above script, not sure if that's how it's possible to go above 100%.

Is this normal to use this much memory? And could this be a potential memory leak?

admin@RT-AC68R /jffs/dnscrypt # top
Mem: 178884K used, 76816K free, 1912K shrd, 1600K buff, 19220K cached
CPU:  9.0% usr  0.0% sys  0.0% nic 45.4% idle 45.4% io  0.0% irq  0.0% sirq
Load average: 0.24 0.38 0.47 1/134 18376
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
  303     1 admin    S     5312  2.0   0  4.5 nt_center
18376 12996 admin    R     1420  0.5   1  4.5 top
13182  2554 nobody   S     778m311.3   1  0.0 /jffs/dnscrypt/dnscrypt-proxy -syslog -config /jffs/dnscrypt/dnscrypt-proxy.toml
26371     1 nobody   S    33588 13.1   0  0.0 dnsmasq --log-async
  179     1 admin    S     6496  2.5   1  0.0 /jffs/dnscrypt/haveged -w1024 -v1
jedisct1 commented 6 years ago

The reason is simple: this column doesn’t indicate memory usage :)

alphabt commented 6 years ago

Looks like I should be looking at RSS

admin@RT-AC68R /jffs/dnscrypt # cat /proc/13182/status
Name:   dnscrypt-proxy
State:  S (sleeping)
Tgid:   13182
Pid:    13182
PPid:   2554
TracerPid:  0
Uid:    65534   65534   65534   65534
Gid:    65534   65534   65534   65534
FDSize: 32
Groups: 0
VmPeak:   796940 kB
VmSize:   796940 kB
VmLck:         0 kB
VmHWM:     13364 kB
VmRSS:     13364 kB
VmData:   790296 kB
VmStk:       136 kB
VmExe:      3496 kB
VmLib:         0 kB
VmPTE:        30 kB
VmSwap:        0 kB
Threads:    11
SigQ:   0/1996
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: fffffffe3bfa3a00
SigIgn: 0000000000200001
SigCgt: fffffffe7fc1fefe
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: ffffffffffffffff
Cpus_allowed:   3
Cpus_allowed_list:  0-1
voluntary_ctxt_switches:    4
nonvoluntary_ctxt_switches: 75

VmRSS at 13364 kB (13mb) isn't too bad. Sorry for the confusion! I'll self close.