On my machine (Linux Mint x64, intentionally zero swap), programs like Firefox and Chrome (running at the same time, because then need to, unfortunately) end up consuming a lot more memory than they have any reason to. And when they go wrong, the whole machine halts.
How do I force some of these tasks to be forcibly limited to a specific memory footprint that they are fully aware of so that they don't try to overrun their maximum memory footprint?
I'm sick and tired of programs like Chrome and Firefox screwing me because they just randomly (from a user perspective) decide, "Hey, I need more memory. Kernel, I need more memory!" instead of "Hey, I need more memory... Crap, I'm out. What do I cut?"
Best I can find, so far is to isolate Chrome and Firefox (individually) to VMs on some other machine with locked-in maximum memory footprints. But, that is highly wasteful, and turns out horribly for things like flash games, especially ones that expect hardware acceleration.
God only knows what is using so much memory, because each browser generally doesn't have more than 15 tabs open. So, that's a further frustration.
How do I force certain programs to live within a certain memory footprint that they are well aware of?
While this question could be limited to just Chrome or Firefox, I'm sure there are other highly wasteful programs that need some kind of restraint. So, while a solution that fixes Firefox and Chrome bad behavior may do what I need, a more general solution is really what I'm wanting.