I'm running my Java app through command line without passing in any JVM settings (i.e. java -cp some.jar).
VisualVM shows the Java app allocated ~740M of Heap space.
Since I didn't pass in any JVM settings, how can I view what JVM settings my app is using?
You can use java.lang.management.MemoryUsage:
MemoryUsage mu = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
and get max memory from it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With