java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|MetaSpaceSize|ThreadStackSize'

 

* 참고 링크

https://www.mkyong.com/java/find-out-your-java-heap-memory-size/