Even ZGC now offers better predictablity than malloc/free allocators (which are a long way from predictable as far latency goes). But some hard-realtime software uses (or at least used to) RTSJ, a hard-realtime version of Java, that separates the heap to a part that uses a GC and a part that uses nested arenas. It was a big deal twenty years ago, when I worked on such software. I don't know how much it's still used. Probably not much. C is still king in that world, and Ada too, to some extent.
It's important to know that for hard realtime, even C alone isn't enough, though, and you need special kernels. Ordinary OS schedulers aren't predictable enough for hard realtime.