How do I find the physical memory size in Java?

前端 未结 7 894
心在旅途
心在旅途 2021-01-07 22:02

I\'m writing an installer that will tune the configuration of the product for the particular hardware on which it will be run. In particular, I want to determine how much p

7条回答
  •  无人及你
    2021-01-07 22:30

    If your intent is to tune memory settings for the JVM to use all the available physical memory, but not more, then you can take a look at the -XX:+AggressiveHeap parameter.

    With it, you don't need to know the available memory. The JVM will scale it's parameters automatically.

提交回复
热议问题