1

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 ?

2
  • 1
    Why 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? Commented 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. Commented Oct 20, 2016 at 22:05

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.