简体   繁体   中英

are the new objects 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 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?

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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM