我知道我在这个回复上完全迟到了,但如果它对遇到同样情况的任何人有帮助,我认为值得在这里写下笔记。我指的是 tomcat 9,因此您可能需要检查此处提到的内容与您的版本的相关性:
在 %CATALINA_HOME%/bin/catalina.bat 中,明确指出:
rem WHEN RUNNING TOMCAT AS A WINDOWS SERVICE:
rem Note that the environment variables that affect the behavior of this
rem script will have no effect at all on Windows Services. As such, any
rem local customizations made in a CATALINA_BASE/bin/setenv.bat script
rem will also have no effect on Tomcat when launched as a Windows Service.
rem The configuration that controls Windows Services is stored in the Windows
rem Registry, and is most conveniently maintained using the "tomcatXw.exe"
rem maintenance utility, where "X" is the major version of Tomcat you are
rem running.
如果您检查 %CATALINA_HOME%/bin 文件夹,您会发现一个名为“tomcat9w.exe”的文件。双击它,您可以看到此屏幕截图,您可以在其中设置 Xms 和 Xmx 参数,以便为您保存到注册表中
希望这可以帮助