4 ms·
No doubt, Java GC is a feat of engineering. But it has to be to avoid being swamped by the lack of mechanical sympathy between the language and memory manageme
by tomohawk 4y ago
No doubt, Java GC is a feat of engineering. But it has to be to avoid being swamped by the lack of mechanical sympathy between the language and memory management. Pretty much everything you do generates lots of unnecessary litter, which then must be eventually collected.
Except in very narrow circumstances, I've not ever seen Java perform at the level of C or C++, especially when I/O is involved. Java typically needs 2-4x the memory and a lot more cores to do the same job. That's fine if you bought the machine and the machine is big enough, but if you're leasing an EC2, why pay more every hour?
These days, my C, C++, and Java days are behind me. We do mostly Go, and couldn't be happier. The GC and language have really good mechanical sympathy, and the bad memories of tuning Java GC are fading. We pay a small tax in terms of CPU and memory over using C, but not remotely like what we saw with Java. And yes, we built prototypes of critical use cases in C just to see how 'bad' Go would be, and were very pleasantly surprised that Go compared very well indeed.