Limit Java Heap Space for play framework globaly

前端 未结 9 1597
無奈伤痛
無奈伤痛 2020-12-04 14:22

I have a very old linux system and installed java and play framework. When I run java I get:

java -version
Error occurred during initialization of VM
Could n         


        
9条回答
  •  醉话见心
    2020-12-04 15:19

    Normally, you can specify Java command line arguments when you call play using the following pattern.

    play run  -Xmx256M -Xms256M
    

    However, looking at the python code for the play run command and the play dependencies command, they invoke Java in different ways.

    The play dependencies command invokes Java without passing through -X commands (for some reason, it passes through -D commands, but not -X). Therefore, there is nothing you can do, apart from editing the deps.py file in framework/pym/play/commands and hard coding the -Xmx and -Xms settings into this file.

    This not a long term solution, and I would suggest you raise a ticket on Play to allow these settings to be read from command line, or from the application.conf, but for now, I see this approach as your only option.

提交回复
热议问题