I didn't test it, but you should be able to monitor the GC by using Java Visual VM.
I have explained this tool here ->
https://ermanarslan.blogspot.com/2017/01/ebs-122-about-java-visual-vm-jvisualvm.htmlJava Visual VM is a GUI-based profiling/monitoring (by Oracle JDK)
If you need a more detailed GC-related information, then you should check jstat and Visual-GC..
The article below is a good one, review it as well->
https://www.cubrid.org/blog/how-to-monitor-java-garbage-collection/