Java接口......动态或静态内存? [英] Java interfaces... Dynamic or static memory?

查看:111
本文介绍了Java接口......动态或静态内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java接口在内存中的位置是什么?它们是驻留在堆还是堆栈中,还是全局内存?我认为它们是在堆栈中,因为它们是在编译时创建的。我是否正确?

Where do java interfaces reside in memory? Do they reside in the heap or the stack, or maybe global memory? I am thinking the are in the stack since they are created at compile time. Am I correct?

推荐答案

类定义 - 包括接口和抽象类 - 保存在PermGen空间中,这意味着它们永远不会垃圾收集。 PermGen是iirc的一部分。

Class definitions -- including interfaces and abstract classes -- are held in PermGen space, meaning they are never garbage collected. The PermGen is, iirc, a part of the heap.

这篇关于Java接口......动态或静态内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆