You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/01/10 12:17:08 UTC

[GitHub] [maven-mvnd] hashhar opened a new pull request #577: Set default max heap size to null

hashhar opened a new pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577


   Let the JVM decide the max heap size instead of using hardcoded defaults
   to match the behaviour of vanilla Maven.
   
   Fixes https://github.com/apache/maven-mvnd/issues/560
   
   I tried adding a test like:
   
   ```java
   Client client = ClientFactory.create(parameters.withJdkJavaOpts("-Xmx200M -XshowSettings"));
   final TestClientOutput output = new TestClientOutput();
   client.execute(output, "verify").assertSuccess();
   output.assertContainsMatchingSubsequence("Max. Heap Size: 200.00M");
   ```
   
   But it fails. It seems the TestClientOutput only contains messages from Maven itself - not the JVM.
   
   Should I try to add a test that verifies that explicitly passing `mvnd.maxHeapSize` is respected and that explicitly passing `-Xmx` works (instead of getting overwritten by `mvnd.maxHeapSize`).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-mvnd] hashhar commented on a change in pull request #577: Set default max heap size to null

Posted by GitBox <gi...@apache.org>.
hashhar commented on a change in pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577#discussion_r781141901



##########
File path: common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
##########
@@ -209,7 +209,7 @@
     /**
      * The <code>-Xmx</code> value to pass to the daemon
      */
-    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),

Review comment:
       I assumed it's fine to keep the heap size as a discriminating flag still since the heap size cannot be changed on the fly and hence is useful to identify the client within the registry.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-mvnd] gnodet commented on pull request #577: Set default max heap size to null

Posted by GitBox <gi...@apache.org>.
gnodet commented on pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577#issuecomment-1009667746


   > Let the JVM decide the max heap size instead of using hardcoded defaults to match the behaviour of vanilla Maven.
   > 
   > Fixes #560
   > 
   > I tried adding a test like:
   > 
   > ```java
   > Client client = ClientFactory.create(parameters.withJdkJavaOpts("-Xmx200M -XshowSettings"));
   > final TestClientOutput output = new TestClientOutput();
   > client.execute(output, "verify").assertSuccess();
   > output.assertContainsMatchingSubsequence("Max. Heap Size: 200.00M");
   > ```
   > 
   > But it fails. It seems the TestClientOutput only contains messages from Maven itself - not the JVM.
   > 
   > Should I try to add a test that verifies that explicitly passing `mvnd.maxHeapSize` is respected and that explicitly passing `-Xmx` works (instead of getting overwritten by `mvnd.maxHeapSize`).
   
   You should be able to get the JVM args by launching the following command inside the test:
   ```
   mvnd org.codehaus.gmaven:groovy-maven-plugin:2.1.1:execute -Dsource="println java.lang.management.ManagementFactory.getRuntimeMXBean().getInputArguments()"
   ```
   and check that the `-Xmx` string does not appear, or appear with the correct number.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-mvnd] hashhar commented on pull request #577: Set default max heap size to null

Posted by GitBox <gi...@apache.org>.
hashhar commented on pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577#issuecomment-1042901914


   @gnodet Can you PTAL. 2 of the 3 tests are working. I've been unable to figure out how to pass mvnd options/get tests to read mvnd.properties to verify that values from mvnd.properties or on command line are being honored or not.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-mvnd] hashhar commented on pull request #577: Set default max heap size to null

Posted by GitBox <gi...@apache.org>.
hashhar commented on pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577#issuecomment-1072412309


   Ping @gnodet


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-mvnd] hashhar commented on pull request #577: Set default max heap size to null

Posted by GitBox <gi...@apache.org>.
hashhar commented on pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577#issuecomment-1018273804


   Sorry for the delay. I have a working test locally now and I'll push in a while. Thanks for guidance @gnodet 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-mvnd] hashhar commented on pull request #577: Set default max heap size to null

Posted by GitBox <gi...@apache.org>.
hashhar commented on pull request #577:
URL: https://github.com/apache/maven-mvnd/pull/577#issuecomment-1072412309


   Ping @gnodet


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org