RFR: 8047998: -XX:InitialHeapSize is unnecessarily set to MaxHeapSize

Guoxiong Li gli at openjdk.org
Wed May 10 11:33:49 UTC 2023


On Wed, 10 May 2023 10:30:48 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Can't say which behavior is "more" unexpected -- `NewSize` means the initial young-size at start-up. Assuming one prints the young-size at start-up, the developer might be surprised if the printed value is diff from `NewSize`.

Another solution: only change the document of the corresponding flags to remind the user and don't change the code.
The draft patch:


diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp
index 1bf74a81706..3ffe8ddeb74 100644
--- a/src/hotspot/share/gc/shared/gc_globals.hpp
+++ b/src/hotspot/share/gc/shared/gc_globals.hpp
@@ -604,7 +604,12 @@
                                                                             \
   product(size_t, MaxNewSize, max_uintx,                                    \
           "Maximum new generation size (in bytes), max_uintx means set "    \
-          "ergonomically")                                                  \
+          "ergonomically."                                                  \
+          "If the InitialHeapSize is equal to MaxHeapSize "                 \
+          "(either of them may be set at command line or "                  \
+          "be set ergonomically), and the NewSize is set at command line, " \
+          "MaxNewSize would be set to the value of NewSize, "               \
+          "even the MaxNewSize is also set at command line.")               \
           range(0, max_uintx)                                               \
                                                                             \
   product_pd(size_t, HeapBaseMinAddress,                                    \



What do you think about it?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13876#issuecomment-1542026524


More information about the hotspot-gc-dev mailing list