Re: GC tuning, one investment bank simply disabled the GC during the trading day: purchasing massive amounts of RAM is cheap, having the GC non-deterministically kick in when you're making a decision or executing a trade is expensive. (Yes, Java isn't the most performant language but lots of developers know it and it's great for testing algos quickly)
Hoping the GC kicks in rarely is not a great strategy. Usually when I see something like this the developers have gone out of their way to write garbage-free code (see Coral Blocks for an example of this.)
If a code is truly garbage free (not sure how practical this is) won't it be independent of the heap size ? I know some teams do claim to write garbage free code to prevent GC from ever kicking of.
Yeah, actually I think you're right. I don't think you can actually disable the GC in JVM unless you patch it.
Truly garbage free is probably not practical 99% of the time. Normally you should just generally try to either have objects that are short-lived or practically permanent.
I'm pretty sure it was a custom VM: I wasn't on the team, but my own group (Unix) was playing with custom IP stacks with the same goal (reducing latency, increasing determinism).
With collectors like CMS, you can control after what percentage of the GC is filled GC will kick in. I think you can use that get the same effect. This is only for old gen.