I have a doubt around the -Xms and other memory argument parameters. Since JVM is a C/C++ implemented program so whenever we try to pass on memory arguments at the runtime does it internally use Malloc/Calloc to assign memory to our Java program ?
-
1Why do you want to know this? Or, what difference would it make if you knew the answer? Which of the many JVM implementations do you mean?Roland Illig– Roland Illig2016-10-20 21:57:18 +00:00Commented Oct 20, 2016 at 21:57
-
I wanted to know the implementation for Hotspot JVM . This will equip be with a better understanding of how JVM works internally. Just to increase my knowledge base.Ganesh Sahu– Ganesh Sahu2016-10-20 22:05:39 +00:00Commented Oct 20, 2016 at 22:05
Add a comment
|
1 Answer
To find out how the HotSpot JVM implements the specification, you can have a look at the actual code.
http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/tip/src/share/vm/runtime/arguments.cpp
Look for size_t max_heap or match_option(option, "-Xmx" and follow the code from there.
Since HotSpot is written in C++, it will probably not use malloc/calloc, but new/delete, but even more probably some kind of mmap.