Can I set Java max heap size for running from a jar file?

后端 未结 8 1784
刺人心
刺人心 2020-11-28 10:16

I am launching a java jar file which often requires more than the default 64MB max heap size. A 256MB heap size is sufficient for this app though. Is there anyway to speci

8条回答
  •  一向
    一向 (楼主)
    2020-11-28 11:01

    This isn't great, but you could have it as an executable JAR, and then in it's main, have it execute itself via the command-line as a non-daemon thread with the proper params stored in a properties file or calculated or whatever, then exit the original. You could even have it execute the jar with another "real" entry-point that expects those parameters.

提交回复
热议问题