Let's run some of the log settings, which are as follows:
- Run the following command:
java -Xlog:cpu -cp ./cookbook-1.0.jar com.packt.cookbook.ch12_memory.Chapter12Memory
There are no messages because the JVM does not log messages with the cpu tag only. The tag is used in combination with other tags.
- Add a * sign and run the command again:
java -Xlog:cpu* -cp ./cookbook-1.0.jar com.packt.cookbook.ch12_memory.Chapter12Memory
The result will look as follows:
As you can see, the tag cpu brings only messages that log time it took a garbage collection task to execute. Even if we set the log level to trace or debug (-Xlog:cpu*=debug ...