In this context, Linux is fairly sensible as it has decent knobs for getting out of the way and is well supported for all of your non-fast-path-code.
Some HFT systems are written in Java - they just give it loads of RAM, disable the garbage collector and restart it once a day.
They profiled the memory leak and gave the chip enough RAM that it wouldn't fill up before the missile exploded. Problem solved!
The thought was that you would rather overheat and perform the calculation than protect the circuit and lose the ship. It's kind of a hail mary strategy. It definitely gave me a visceral feeling for how one should be ready to re-frame their systems analyses, even if apocryphal.
If the mock data is good, you can do the whole thing in testing and fail tests if new code introduces GC events. However the Java code you have to write end up being very C like.
Though perhaps one could write a program in a way that gets reliably jitted?