是从 eden 空间或 eden + 分配的新对象来自幸存者空间?
新对象是从 eden 空间还是 eden + fromSurvivor 空间分配的? 幸存者空间中的可用空间也可以用于分配给新对象吗?
编辑 : 考虑以下场景: 假设Eden空间已满并且来自幸存者空间的占用较少,那么在这种情况下,如果创建新对象(新对象足够小以适合来自幸存者空间),那么将发生次要收集或者将从中分配新对象的空间来自幸存者空间?
are the new objets assigned from eden space or eden + fromSurvivor space ?
can free space in from survivor space be also used for allocation to new objects?
EDIT :
consider the scenario:
suppose Eden space is full and from survivor space occupancy is less, then in that case if new object is created (new object is small enough to fit into from survivor space) then will the minor collection occur or space for new object will be allocated from fromSurvivor space?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信伊甸园空间总是用于小对象,非常大的对象直接分配在旧空间中。如果在幸存者空间中分配新对象,则有点违背了拥有单独空间的目的。
有关更多详细信息,请参阅此 PDF,包括:
I believe eden space is always used for small objects, and very large objects are allocated directly in old space. If new objects were allocated in the survivor space, it would kinda defeat the point of having separate spaces.
See this PDF for more details, including: