Remove default values for heap options (#610)

* Set default max heap size to null

Let the JVM decide the max heap size instead of using hardcoded defaults
to match the behaviour of vanilla Maven.

* Add ITs for verifying max heap behaviour

- By default no max heap should be set
- If configured via jvm.config then max heap should be set but not mvnd.maxHeapSize
- If configured via mvnd.maxHeapSize then max heap should be set

* Remove defaults memory options

* Add missing test project

* Fix too small heap size

* Fix tests

Co-authored-by: Ashhar Hasan <hashhar_dev@outlook.com>
This commit is contained in:
Guillaume Nodet
2022-04-26 13:22:37 +02:00
committed by GitHub
parent 8b2d8dc1f2
commit 73f4d50bcb
14 changed files with 237 additions and 85 deletions

View File

@@ -204,17 +204,17 @@ public enum Environment {
* The <code>-Xms</code> value to pass to the daemon.
* This option takes precedence over options specified in {@link #MVND_JVM_ARGS}.
*/
MVND_MIN_HEAP_SIZE("mvnd.minHeapSize", null, "128M", OptionType.MEMORY_SIZE, Flags.DISCRIMINATING),
MVND_MIN_HEAP_SIZE("mvnd.minHeapSize", null, null, OptionType.MEMORY_SIZE, Flags.DISCRIMINATING | Flags.OPTIONAL),
/**
* The <code>-Xmx</code> value to pass to the daemon.
* This option takes precedence over options specified in {@link #MVND_JVM_ARGS}.
*/
MVND_MAX_HEAP_SIZE("mvnd.maxHeapSize", null, "2G", OptionType.MEMORY_SIZE, Flags.DISCRIMINATING),
MVND_MAX_HEAP_SIZE("mvnd.maxHeapSize", null, null, OptionType.MEMORY_SIZE, Flags.DISCRIMINATING | Flags.OPTIONAL),
/**
* The <code>-Xss</code> value to pass to the daemon.
* This option takes precedence over options specified in {@link #MVND_JVM_ARGS}.
*/
MVND_THREAD_STACK_SIZE("mvnd.threadStackSize", null, "1M", OptionType.MEMORY_SIZE, Flags.DISCRIMINATING),
MVND_THREAD_STACK_SIZE("mvnd.threadStackSize", null, null, OptionType.MEMORY_SIZE, Flags.DISCRIMINATING | Flags.OPTIONAL),
/**
* Additional JVM args to pass to the daemon.
* The content of the <code>.mvn/jvm.config</code> file will prepended (and thus with