I want to understand the difference between:
-XX:+PrintGC
and -verbose:gc
Apparently these look similar.
This article doesn't list the verbose:gc
http://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html
I also saw these two questions: How to redirect verbose garbage collection output to a file? and https://stackoverflow.com/a/1818039/2266682 but couldn't get much understanding.
Update: Bakuriu commented to point out that there is a small difference between the print function and the print statement (and more generally between a function and a statement). print "something", 1/0, "other" #prints only something because 1/0 raise an Exception print ("something", 1/0, "other") #doesn't print anything.
Difference between print() and println() in Java. print(): print() method in Java is used to display a text on the console. This text is passed as the parameter to this method in the form of String. This method prints the text on the console and the cursor remains at the end of the text at the console. The next printing takes place from just here.
Closely related to the physical or digital nature of a design is how users experience it. Both print and web design share a visual quality in common — the design needs to make a good impression no matter what the final product.
sys.stdout.write won't write non-string object, but print will sys.stdout.write won't add a new line symbol in the end, but print will sys.stdout is a file object which can be used for the output of print ()
In JDK 8 -verbose:gc
is an exact alias for -XX:+PrintGC
.
However, -verbose:gc
is a standard option, while -XX:+PrintGC
is not.
-XX:+PrintGC
is deprecated since JDK 9 in favor of unified logging option -Xlog:gc
, see JEP 158.-verbose:gc
still works in JDK 9 and 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With