Reputation: 1474
A while ago, I stumbled upon some monitoring code for garbage collections using JMX API. However, this is making Java8 angry since it is not considered API anymore. GcInfo
and friends are restricted API now. Is is now discouraged to obtain GC information programmatically or is there another preferred way or should I just ignore the warning?
Upvotes: 0
Views: 604
Reputation: 719576
Java is not "angry" with you. It is merely informing you that you are using Oracle-specific APIs.
The APIs you are using are described here as:
com.sun.management
- Oracle's platform extension to thejava.lang.management
API and the management interface for some other components of the platform.
If you need detailed monitoring information on the garbage collector, this is the way to get it. You just need to be aware that this may not work for other implementations of Java.
... should I just ignore the warning?
It would be best to suppress the specific warnings that you have decided are not applicable to your use-case.
Upvotes: 2