Isn't that just risking a crash? Why not just allocate a 300GB heap and hope GC kicks in rarely?
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.