Skip to content

The reported freed memory is incorrect #262

Open
@Kadri314

Description

@Kadri314

There are some cases, the GC pauses increase the memory heap size, example below:

[2022-08-23T14:36:33.337+0200][0.157s] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 147M->148M(1028M) 7.903ms --> increased by 1mb

the GCVIWER in this case will do the following:
before= 147
after=148
totalFreedMemory+=before - after ;
--> in this case we subtract the totalFreedMemory by (1)

The solution should avoid adding into the totalFreedMemory when before-after is <0 :
before= 147
after=148
diff= before - after
totalFreedMemory+= diff >= 0 ? diff : 0

Please apply a fix to this issue, as the reported totalFreedMemory is incorrect.

Regards,
Alkadri

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions