Eduard Bloch <e...@gmx.de> writes: >> > We use apt-cacher-ng in the office to reduce the cost of updates, for which >> > it works great. However, after moving from an Etch machine to a Lenny > > .oO( https://flattr.com/thing/51105/Apt-Cacher-NG is the place to say > Thanks! )
I will try again to work out how to drive that in a bit. :) >> > machine running apt-cacher-ng we hit trouble with memory exhaustion. >> >> [...] >> >> > It turns out that the troublesome setting is: >> > MaxStandbyConThreads: 2 >> > >> > With that enabled, memory leak, with it commented out, nothing. >> >> Sadly, this turns out to be untrue: with this setting enabled I can reproduce >> the leak using a local loop of 'aptitude update' calls; with it disabled the >> problem hides from that, but still shows up as our remote machines perform >> their updates through the day. > > I found a couple of issues which might cause the leak. I will send you a > current development snapshot tonight. Thanks. > In the meantime, could you please check which resources are leaked? OK: Top gives me this: 20471 apt-cach 20 0 1451m 4612 1080 S 0 0.2 0:03.47 apt-cacher-ng So, at 1.4GB we have reproduced the issue, whatever it is. > File handles? lsof -n | grep apt-ca Nothing untoward from lsof that I can see: apt-cache 20471 apt-cacher-ng cwd DIR 0,25 4096 12591412 / apt-cache 20471 apt-cacher-ng rtd DIR 0,25 4096 12591412 / apt-cache 20471 apt-cacher-ng txt REG 0,25 295088 12756410 /usr/sbin/apt-cacher-ng apt-cache 20471 apt-cacher-ng mem REG 253,2 12756410 /usr/sbin/apt-cacher-ng (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12708508 /lib/libnss_files-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12708487 /lib/libresolv-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12705894 /lib/libnss_dns-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12707248 /lib/libc-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12706402 /lib/libgcc_s.so.1 (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12706202 /lib/libm-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12755862 /usr/lib/libstdc++.so.6.0.10 (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12706226 /lib/libbz2.so.1.0.4 (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12755130 /usr/lib/libz.so.1.2.3.3 (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12708515 /lib/libpthread-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng mem REG 253,2 12708507 /lib/ld-2.7.so (path dev=0,25) apt-cache 20471 apt-cacher-ng 0u CHR 1,3 12706156 /dev/null apt-cache 20471 apt-cacher-ng 1u CHR 1,3 12706156 /dev/null apt-cache 20471 apt-cacher-ng 2u CHR 1,3 12706156 /dev/null apt-cache 20471 apt-cacher-ng 3w REG 0,25 2181 12976483 /var/log/apt-cacher-ng/apt-cacher.err apt-cache 20471 apt-cacher-ng 4w REG 0,25 7549180 12976454 /var/log/apt-cacher-ng/apt-cacher.log apt-cache 20471 apt-cacher-ng 5u IPv6 347670112 TCP *:3142 (LISTEN) apt-cache 20471 apt-cacher-ng 6u IPv4 347670113 TCP *:3142 (LISTEN) apt-cache 20471 apt-cacher-ng 7u unix 0xffff8103f50c6680 347670114 /var/run/apt-cacher-ng/socket > Processess/Threads/Memory? ps aux -L | grep apt-ca Three rows from ps: 108 20471 20471 0.0 3 0.2 1486820 4612 ? Ssl 18:01 0:00 /usr/sbin/apt-cacher-ng -c /etc/apt-cacher-ng pidfile=/var/run/apt-cacher-ng/pid SocketPath=/var/run/apt-cacher-ng/socket foreground=0 108 20471 23616 0.0 3 0.2 1486820 4612 ? Ssl 18:11 0:00 /usr/sbin/apt-cacher-ng -c /etc/apt-cacher-ng pidfile=/var/run/apt-cacher-ng/pid SocketPath=/var/run/apt-cacher-ng/socket foreground=0 108 20471 24201 0.0 3 0.2 1486820 4612 ? Ssl 18:19 0:00 /usr/sbin/apt-cacher-ng -c /etc/apt-cacher-ng pidfile=/var/run/apt-cacher-ng/pid SocketPath=/var/run/apt-cacher-ng/socket foreground=0 What does look to leak is anonymous memory: r...@fitz-deb01:~# /tmp/proc-maps 20471 Backed by file: Executable r-x 3644 Write/Exec (jump tables) rwx 0 RO data r-- 36 Data rw- 92 Unreadable --- 20460 Unknown 0 Anonymous: Writable code (stack) rwx 311308 Data (malloc, mmap) rw- 1019932 RO data r-- 0 Unreadable --- 131352 Unknown 0 I attached the code for proc-maps, but it basically just sums memory allocations. On the same hunch /proc/.../maps and /proc/.../smaps are both attached, although I don't think they tell much more than the summary above. Daniel -- ✣ Daniel Pittman ✉ dan...@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons
proc-maps
Description: Binary data
maps
Description: Binary data
smaps
Description: Binary data