Grails 独立 JAR 作为 linux 服务配置内存参数

Grails standalone JAR as linux service configure memory parameters

我有一个 Grails 应用程序,我 运行 作为 Linux 服务。基本上我创建了一个从 /etc/init.d/mygrailsservice 到 mygrailsservice.jar.

的符号链接

我想增加分配给服务的 OS 内存量。

我该如何配置?

查看可执行 jar 的 spring-boot 文档并将它们用作系统服务 - https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html

具体来说https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-script-customization-when-it-runs

With the exception of JARFILE and APP_NAME, the above settings can be configured using a .conf file. The file is expected next to the jar file and have the same name but suffixed with .conf rather than .jar. For example, a jar named /var/myapp/myapp.jar will use the configuration file named /var/myapp/myapp.conf.

myapp.conf.

JAVA_OPTS=-Xmx1024M

LOG_FOLDER=/custom/log/folder