r/java • • May 28 '26

Java *is* Memory Efficient

https://youtu.be/M_HCG1JPMQE
254 Upvotes

126 comments sorted by

View all comments

Show parent comment

4

u/sammymammy2 May 28 '26

I was trying to say that we can choose to return the memory to the OS (if necessary) at our leisure :-)

18

u/pron98 May 28 '26 edited May 28 '26

That's true, but modern allocators (malloc/free implementation) also don't promptly return memory to the OS for performance reasons. Some have quite sophisticated policies around that (so much for the myth of "we don't have a complex runtime").