其他分享
首页 > 其他分享> > JDK 13 import new and removed

JDK 13 import new and removed

作者:互联网

JDK 13 Release Notes

https://www.oracle.com/technetwork/java/javase/13-relnote-issues-5460548.html#NewFeature

1. hotspot/gc ➜ JEP 351 ZGC Uncommit Unused Memory
    ZGC was enhanced to return unused heap memory to the operating system. This is useful for applications and environments where memory footprint is a concern.
    This feature is enabled by default, but can be explicitly disabled using -XX:-ZUncommit. Furthermore, memory will not be uncommitted so that the heap size shrinks below the minimum heap size (-Xms). This means this feature will be implicitly disabled if the minimum heap size (-Xms) is configured to be equal to the maximum heap size (-Xmx).
An uncommit delay can be configured using -XX:ZUncommitDelay=<seconds> (defaults to 300 seconds). This delay specifies for how long memory should have been unused before it's eligible for uncommit.

2. hotspot/gc ➜ Added -XXSoftMaxHeapSize Flag

   The manageable command-line flag -XX:SoftMaxHeapSize=<bytes> has been added. Currently, it only has an effect when the Z garbage collector is enabled (-XX:+UseZGC).
   When set, the GC will strive to not grow the heap beyond the specified size, unless the GC decides it's necessary to do so to avoid OutOfMemoryError. The soft max heap size is not allowed to be set to a value greater than the maximum heap size (-Xmx). When not set on the command line, it defaults to a value equal to the maximum heap size.
   Being manageable, its value can be adjusted at runtime. For example, its value can be adjusted by using jcmd VM.set_flag SoftMaxHeapSize <bytes> or through the HotSpot MXBean.
Setting this flag can be useful in a number of situations, such as:
    In environments where resource usage is a concern, you might want to keep the heap footprint down while also retaining the capability to deal with a temporary increase in heap space requirement.
    When using a concurrent GC (such as ZGC), you might want to play it safe and increase the confidence level that you will not run into an allocation stall because of an unforeseen increase in allocation rate. Setting a soft max heap size encourages the GC to maintain a smaller heap, which means the GC will collect garbage more aggressively than it otherwise would, making it more resilient to a sudden increase in the application allocation rate.

3. hotspot/gc ➜ ZGC Maximum Heap Size Increased to 16TB

    The maximum supported heap size for ZGC was increased from 4TB to 16TB.

4. core-libs/java.lang➜ Removal of Runtime Trace Methods
    The obsolete methods traceInstructions(boolean) and traceMethodCalls(boolean) have been removed from the java.lang.Runtime class. These methods have been non-functional for many releases, and their intended functions are provided by the Java Virtual Machine Tool Interface (JVMTI).

5. hotspot/runtime➜ Removal of VM option -XX+AggressiveOpts
    The VM option -XX:+AggressiveOpts was deprecated in JDK 11 and support for it was removed in JDK 12 (where its use was ignored other than generating a warning). Use of this flag will now cause an error on VM initialization.

 

标签:13,ZGC,will,XX,GC,heap,import,removed,size
来源: https://blog.csdn.net/yangkei/article/details/102776514