当前位置: 动力学知识库 > 问答 > 编程问答 >

java - are the new objets assigned from eden space or eden + fromSurvivor space?

问题描述:

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 scenerio :

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 ?

网友答案:

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:

Most objects are initially allocated in Eden. (As mentioned, a few large objects may be allocated directly in the old generation.)

分享给朋友:
您可能感兴趣的文章:
随机阅读: