I read on the JVM memory model and got confused with the follows:
I would really appreciate any help on the topic.
Thanks.
1) .class
file will be store in permgen memory area on load.
2) Objects on HEAP will be created while program run, when you explicitly create, not on load. The JVM compiles methods 'lazily', that is it emits small stubs in place of the compiled machine code of the method that will trigger the compilation of each method. This means that methods that are not used are never compiled.
3) perm gen stores bytes code (.class file will be loaded), not sure about machine level code.
Does the JVM store the .class instance in its memory.If yes then in which area
PermGen
Is it like as soon as the class is loaded
You can load the class without reading the .class
,the JVM generated machine level code and then starts executing the machine code instructions
The byte code is interpreted or potentially compiled to native machine code some time later.
The perm gen etc areas store the byte code or the machine level code?
Both. They are inseparable.
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