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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -