Forwarding Tables overhead

Jean-Philippe Bempel jean-philippe.bempel at datadoghq.com
Fri May 9 07:01:08 UTC 2025


On Wed, May 7, 2025 at 1:53 PM Erik Osterlund <erik.osterlund at oracle.com> wrote:
> Going back to the problem domain - is the problem you are facing around average memory efficiency, or rather about accounting for temporary spikes? And by accounting I mean figuring out what heap size to select so that the OOM killer doesn’t kill you. In other words, the problem of figuring out how much *maximum* non-heap memory the JVM uses so that the entire process and not just the heap fits into the container.

Yes the underlying problem related to OOMkill is this accounting for
forwarding table usage that is surprising and very difficult to
evaluate.

>
> The reason I ask is that I think automatic heap sizing (cf. https://openjdk.org/jeps/8329758) more or less solves the accounting problem. But if there is an actual memory efficiency problem in a real application, then that would be good to know about, and there are indeed various different ways of solving that.

Right now the memory efficiency is less of a problem, this is the
non-heap memory that is more a concern for right sizing containers.
Having said that, even if the heap is able to handle the spike of
allocation we have significant overhead on the next GC cycle because a
lot of objects may have been evacuated.

>
> So I wonder what percent of the container memory is spent on forwarding tables on average in your program and what the largest spikes are between two GC cycles. Do you think you could get any data around that?

Usually the forwarding usage is between 0 and 512MB. On the spike the
GC structs from NMT JFR event indicates a maximum of 3.3GB

Thanks
Jean-Philippe Bempel


More information about the zgc-dev mailing list