1 For HotSpot JVM young generation, is it possible to skip garbage collection (gc) for the most newly allocated objects in eden? For example, we skip the top 30% most newest objects in eden area.
When you clean up Eden, it is all or nothing. The newest objects are more likely to be in the survivor space and be cleaned up in the next collection.
2 How to reduce the time for the new generation gc? The response time of a workflow is expected to be less than 10 ms, but the copying process of gc for new generation alone takes 8 ms.
The JVM is not a hard real time system. This means there is always a chance it will pause for 10 ms even without a GC. Instead of saying 10 ms response, a more realistic goal is to have < 10 ms 99% of the time. This allows for some small collections.
If you want to really reduce GC pause times you can either; use Azul Zing as it has a concurrent collector (commercial), or reduce the amount of garbage you product to less than your eden size in a day. e.g. set the eden size to 24 GB and produce less than 1 GB per hour.