Java's serial garbage collection works on a single thread. When executing, it freezes all other threads until garbage collection operations have concluded. Due to the thread-freezing nature of serial garbage collection, it is only feasible for very small programs.
To manually invoke the serial garbage collection algorithm for your application, use the following command-line option:
-XX:+UseSerialGC