Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between -XX:+PrintGC and -verbose:gc

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.

like image 928
Syed Aqeel Ashiq Avatar asked Apr 02 '18 09:04

Syed Aqeel Ashiq


People also ask

What's the difference between the print function and the print statement?

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.

What is the difference between print () and println () in Java?

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.

What are the similarities between print and digital design?

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.

What is the difference between stdout write and print in C++?

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 ()


1 Answers

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.

like image 84
apangin Avatar answered Sep 19 '22 22:09

apangin