During a recent G1 TOI, a GC log entry for a full GC was shown:
9.239: [Full GC (No GC) 128M->125M(128M), 9.0804393 secs]
which is showing "No GC" as the cause.
It turns out that this is incorrect and we have path in G1 where we do not set the GC cause.
Set the GC cause using an instance of the GCCauseSetter class.
GC cause not being set when a full GC is invoked from VM_G1CollectForAllocation