<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">I found a huge memory leak when SQM shaper is engaged on my MT7620N-powered router. It regards IPv6 operation only though.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">How to test:</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">1. Obvious part: sqm-scripts package has to be installed, /etc/config/sqm has to be configured with shaper and cake or fq_codel qdisc enabled.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">2. Your connection has to support IPv6 because memory starts leaking only with IPv6 TCP transfers (I have tested downlink, not sure about uplink).</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">3. You need to ssh to your router and monitor system resources with top -d 1 (for better resolution).</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">4. Now it's time to engage some huge file download straight to /dev/null. Debian 10 image will do. Run wget -6 <a href="https://caesar.ftp.acc.umu.se/debian-cd/current/amd64/iso-cd/debian-10.3.0-amd64-netinst.iso" style="box-sizing: border-box; color: rgb(58, 171, 255); text-decoration: none;">https://caesar.ftp.acc.umu.se/debian-cd/current/amd64/iso-cd/debian-10.3.0-amd64-netinst.iso</a> -O /dev/null.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">5. Watch your router memory drains to zero. Notice that ksoftirqd process is suspiciously active (about 19% CPU, it's quite untypical).</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">6. Try wget with -4 flag to confirm that only IPv6 operation is affected.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">What I figured at the moment:</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">1. UDP transmission are not affected. Torrents work just fine with IPv6 peers, no leaks.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">2. Utility doesn't matter. I tried curl, few browsers, no difference.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">3. It is related to shaper because if you set it to zero in configuration, effectively disabling it, leak stops.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">4. IPv4 downloads doesn't cause the leak.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">5. Kernel doesn't show what process misbehaves with memory.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">I have no knowledge of what exactly causes the leak apart from it having something to do with shaper function. I don't have any means of using a debugger on the router since it's quite restricted on resources.</p><p style="box-sizing: border-box; word-wrap: break-word; word-break: break-word; margin: 0px 0px 10px; caret-color: rgb(26, 26, 27); color: rgb(26, 26, 27); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-text-size-adjust: 100%;">P.S. My WAN connection is a USB LTE modem.</p></body></html>