Skip to content

Commit

Permalink
Discarded bytes in Verbose GC
Browse files Browse the repository at this point in the history
Report existing cummulative discarded bytes in allocation stats section
of VGC (reported as a part of GC-start increment).

At the present they are only TLH discards, although in theory there
could be small discards from non-TLH allocations when remainder is less
then min free entry, but we don't gather those stats. It's not
specifically reported as TLH ones, since in future we might add non-TLH
ones, too.

This is useful to report/check if TLH sizing is changed (via for example
tlhMaximumSize paramter), to see if there is any negative sideeffect
(increase of discards, which may potentially increase frequency of GCs).

Signed-off-by: Aleksandar Micic <Aleksandar_Micic@ca.ibm.com>
  • Loading branch information
Aleksandar Micic authored and Aleksandar Micic committed Feb 5, 2024
1 parent 3e1bb69 commit 94a5279
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gc/verbose/VerboseHandlerOutput.cpp
Expand Up @@ -887,7 +887,7 @@ MM_VerboseHandlerOutput::printAllocationStats(MM_EnvironmentBase* env)
OMRPORT_ACCESS_FROM_OMRPORT(env->getPortLibrary());

enterAtomicReportingBlock();
writer->formatAndOutput(env, 0, "<allocation-stats totalBytes=\"%zu\" >", systemStats->bytesAllocated());
writer->formatAndOutput(env, 0, "<allocation-stats totalBytes=\"%zu\" discardedBytes=\"%zu\" >", systemStats->bytesAllocated(), systemStats->_tlhDiscardedBytes);

if (_extensions->isVLHGC()) {
#if defined(OMR_GC_VLHGC)
Expand Down
1 change: 1 addition & 0 deletions gc/verbose/schema.xsd
Expand Up @@ -344,6 +344,7 @@ xmlns:vgc="http://www.ibm.com/j9/verbosegc">
<element ref="vgc:largest-consumer" maxOccurs="1" minOccurs="0" />
</sequence>
<attribute name="totalBytes" type="integer" use="required" />
<attribute name="discardedBytes" type="integer" use="required" />
</complexType>

<complexType name="allocated-bytes">
Expand Down

0 comments on commit 94a5279

Please sign in to comment.