The most straightforward, and often most useful, way of monitoring the Java™ heap is by seeing what garbage collection is doing.
-Xverbosegclog:[DIR_PATH][FILE_NAME]where:
[DIR_PATH] is the directory where the file should be written [FILE_NAME] is the name of the file to write the logging to
See Garbage Collector diagnostics for more information about verbose GC output and monitoring.