I have a real-life case where this was crucial. We were in a AI class where we had to implement some form of greedy, heuristic-based search. I don't remember the details (it was 5 years ago), but I do remember this:
The base program allocated and deallocated lots of memory very quickly
The program was written in Java
The program ran out of memory because the garbage collector couldn't react to the speed at which memory needed to be deallocated. There was a better way to implement it? Surely. I don't remember the details.
But my takeaway from that is exactly what you said: more precise / deterministic control over memory is highly desirable for certain use-cases. I know that program would've ran fine in C or Rust. In Java, it quickly ran out of resources.
100% this. There are some language features that make optimizing harder/easier, but itās all about control and determinism (to some extent), as @Ixrec put it.
Java is actually pretty fast, once JITād (and to some degree, if written a certain way). And itās fast to the point where choice of algorithm, data structure, or even small optimizer miscues can make it run faster or slower than C++ or Rust. Itāll use a lot more memory for the same working set, thatās pretty much a given.
And Iād venture itās very much non-trivial to write a large system where you can beat Java performance (throughput wise), particularly servers.