4 ms·
A good start but it’s really a brief survey and I wouldn’t call it actionable. The greatest challenges for Java gc is when heap sizes are big and when data is
by ryanobjc 7y ago
A good start but it’s really a brief survey and I wouldn’t call it actionable.
The greatest challenges for Java gc is when heap sizes are big and when data is turned over slower than pure transactional. In other words allocate and retain for a while and free, with a 32gb heap. That’s where gc tuning becomes a dark art.
The bottom line is allocation rapidly and keeping up with that is easy enough. Mix in hundreds of parallel and live app threads, large memory structures that live for minutes or hours, and add a transactional gc turnover.
I think go does so well because if you want a cache in go you get smart and use the c escape route.
- grandinj 7y agoFor large data structures I sometimes move them off the Java heap using the NIO/ByteBuffer APIs, which keeps my normal working set smaller. Only works for certain use-cases though.
- kjeetgill 7y agoJava Unsafe can be great for moving things off heap too. And this is also the kinda place where pooling in Java can help more than it hurts. But all these solutions have a few sharp edges and aren't universally helpful. If/when Valhalla lands it'll help soften a few of the rough edges here.