I was told when I was investigating the cause of a memory leak at work. Make a note so as not to forget it.
First, find out the PID of the Java process you want to cause the GC. The story is then.
$ jps
#Java PID running on the same machine comes out with Walla Walla.
Specify the target PID and execute.
$ jcmd <PID> GC.run
I was monitoring with VisualVM, but the memory usage dropped sharply.