title: How to set maximum heap size (-Xmx) for Java application that gets started via "gradle run"?
body: <p>If we want to clean, build and then run our application, we use <code>./gradlew clean run</code>.
  <code>run</code> is part of <a href="https://docs.gradle.org/current/userguide/application_plugin.html" rel="nofollow noreferrer">the Gradle Application plugin</a>.</p>
  
  <p>What we want to achieve is to assign a certain maximum heap size to the application using <code>run</code>, something similar to <code>./gradlew clean run -Xmx1G</code>.
  The result should equal running <code>java -Xmx16G -jar /path/to/my/app.jar</code>.</p>
  
  <p>Is there a way to achieve this?</p>
  
  <hr>
  
  <p><em>Edit: Just to make sure, I do not want to increase the build deamons's max heap but the max heap of the application that gets started by gradle.</em></p>