Memory Allocation
Garbage Collection in Java
转载ØAll local variables are stored on a stack
§These variables are de-allocated in a last in first out (LIFO) fashion as soon as the method terminates
§All local references are stored on stack
ØAll arrays objects and other objects are stored on heap
§They need not be de-allocated in any specific order
§They can be garbage collected (removed from the memory) when their use is over
ØAll instance variables are stored on heap as part of their Objects
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
java:垃圾回收机制(Garbage Collection)
java的垃圾回收机制,可以让程序员把更多的经历放在业务逻辑上。
垃圾回收机制 业务逻辑 java