Run application via gradlew with -Xmx and -Xms

前端 未结 3 1942
忘掉有多难
忘掉有多难 2021-02-11 23:15

I have an application. I run it via

gradlew run-app

Or debug

gradlew debug-app

It works. How do I pass \'-Xm

3条回答
  •  灰色年华
    2021-02-11 23:32

    Firstly, thanks @ToYonos for leading me to the right direction.

    Secondly, I found the solution here https://stackoverflow.com/a/9648945/4587961. I ran my app from command line.

    set GRADLE_OPTS=-Xms1724m -Xmx5048m
    gradlew debug-app
    

    Note, CMD Windows command SET works locally, so if you close your terminal, GRADLE_OPTS will not be set. For Linux, you can use

    export GRADLE_OPTS=WHATEVER
    

    This is what I wanted to achieve.

提交回复
热议问题