Use the -Xverbose:gc utility to obtain information about the Java™ Object heap in real time while running your Java applications.
java -verbose:gc
For more information, see Using verbose:gc information.