java 文件保存在内存,Java .class文件是否存储在JVM内存中

I read on the JVM memory model and got confused with the follows:

Does the JVM store the .class instance in its memory. If yes then in which area.

Is it like as soon as the class is loaded,the JVM generated

machine level code and then starts executing the machine code

instructions and then only the objects are created on heap and

method area is populated.

The perm gen etc areas store the byte code or the machine level

code?

perm gen vs method area

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值