![]() All the newly created objects are allocated in Eden space. New generation in turn has 3 parts, Eden, Survivor1 and Survivor2. ![]() Young generation is the memory space where all the newly created objects are allocated. The heap memory can be divided into three parts: The unused objects in the heap memory are cleared automatically by the Garbage Collector in Java. The size of heap memory is large when compared to stack. Heap follows dynamic memory allocation scheme (memory is allocated during execution or at runtime) and provides random and global access to objects created, unlike stack, which follows Last-In-First-Out (LIFO) memory access order. The references to the objects that are created in the heap are stored in the stack memory. Heap memory is used to store the objects that are created during the execution of a Java program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |