Get JVM to grow memory demand as needed up to size of VM limit?

后端 未结 14 1403
渐次进展
渐次进展 2020-12-29 07:42

We ship a Java application whose memory demand can vary quite a lot depending on the size of the data it is processing. If you don\'t set the max VM (virtual memory) size

14条回答
  •  温柔的废话
    2020-12-29 08:13

    I think you're out of luck :-( The -Xms and -Xmx options don't provide that flexibility.

    So I think you will need to wrap your JVM invocation with a script that can determine the maximum amount of memory, and then set -Xmx appropriately (probably a .vbs script using WMI on Windows). Or perhaps it asks the users the first time it's run ?

    A bit of a pain, I fear.

提交回复
热议问题