I have an OmniTik tower that also serves as a gateway router. It's limited to 32MB. Recently, I've been getting out-of-memory crashes on it. When I checked on it, it was running with 5MB free, and for short periods as little as 800K. I can't find a way to determine what's actually using memory, so I've been guessing in an attempt to free some more up.
I cut the logging memory down to 100 lines (no appreciable change); disabled the openflow package which I had installed planning to use it later (saved about 1MB), deleted a bunch of disabled rules from my firewall (no change), and looked for queue trees (there wasn't any -- all there was was a single simple queue for one attached user). I have about 90 active firewall rules, all of which do necessary stuff. I could disable ipv6 if I really had to, I'd just feel antisocial.
I looked at tools profile. Most of the time, the router is 82% idle. Every so often there is a spike in flash and management, which I suspect is just log lines writing to disk. Every so often, CPU briefly spikes to 100% in the Winbox menu bar, but it's not easy to catch the reason in profile.
I have a hard time believing that this router needs 26MB for what I ask it to do, but maybe I'm overlooking something. It does NAT about 60 machines, so maybe this is a factor. Again, there's no way I can find to ask the router to simply tell me where all this memory is going. I can't even find the packages' memory requirements in the wiki.
Where else should I look? What else should I cut?