java - where does a "static final" directly allocated into? young gen or old gen or perm gen? -
is "static final" directly allocated young gen or old gen or perm gen? (i guess land old gen on time suppose.) if allocated in perm gen then, garbage collected when class unloading takes place in perm gen ?
is "static final" directly allocated young gen or old gen or perm gen?
an object referenced static final
variable allocated according same rules other object. allocated in young generation, or in old generation (if large , other conditions apply).
the object allocated new
executing in arbitrary code. jvm not in position know object (eventually) assigned static final
variable.
the space frame containing static variables allocated in permgen. of course, not regular java object.
if allocated in perm gen then, garbage collected when class unloading takes place in perm gen?
that depends on whether permgen garbage collected. in modern jvms is, , expect objects referenced unloaded classes statics garbage collected in same gc cycle, or next 1 ... assuming unreachable.
either way, should not code application depend on of these details. jvm specific.
Comments
Post a Comment