Where does the JVM store primitive variables?

后端 未结 3 1499
误落风尘
误落风尘 2020-12-04 11:54

Where does the Java JVM store primitive variables, and how is the memory used by primitives freed after use?

I guess it is on the stack?

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 12:15

    • Class objects, including method code and static fields: heap.
    • Objects, including instance fields: heap.
    • Local variables and calls to methods: stack..

提交回复
热议问题