Memory Leaks in 18.06.1?

I am running OpenWrt 18.06.1, r7258-5eb055306f (official release) on RT-AC58U, things are fine but after running for 10 to 15 days router becomes slow unresponsive and overall memory available become as low as 2MB and memory allocations start to fail by various processes. I am trying to determine which process is leaking memory. Is it some thing already know?

top or htop may help you to see if a specific process is causing problems.

What are you running on your router?

Even 128 MB of RAM isn't a lot for both the RAM disk that backs /var/ and /tmp/ along with things that constantly allocate and deallocate memory.

Thanks for pointing out about /tmp, looks like stubby has crashed and a core dump is generated in /tmp. Now I have changed kernel.core_pattern to /dev/null and observe few more days.

you shoud have a swap partition. I have the same router running unbound, adblock, wireguard ... for months.

I am thinking about swap partition, did you set it up on usb storage?

Yes, I'm using a USB harddrive which has a swap partion of 512 MB and other partition for sharing and downloading.