I have an application. I run it through
gradlew run-app
Or debug
gradlew debug-app
It works. How to pass the argument "-Xmx" to the application that I run (debug)? Is it possible to do this without editing the build.gradle file?
I found this gradle unknown command line option '-X'
I get a similar error when trying
gradlew debug-app -Xmx2000m
Error
FAILURE: Build failed with an exception. * What went wrong: Problem configuring task :debug-app from command line. > Unknown command-line option '-X'.
I tried to create a gradle.properties file in the gradle.properties directory (the default is USER_HOME / .gradle).
org.gradle.jvmargs=-XX\:MaxHeapSize\=4256m -Xmx4256m -Xms2000m
I also tried org.gradle.jvmargs=-Xmx2000m in the project folder gradle.properties .
And even when I launch the application, I see that the size of Commited Memory is <520 MiB

And this is when I run it as a regular Java application

In the second case, when I run the application as a regular Java application with -Xms, -Xmx, the Commited Memory size is about 3.5 GB, because I passed the parameters -Xmx4512m -Xms2512m .
source share