Answer:
When an object is created, if the object size is greater than 85000 bytes, it will be created in a separate heap called, Large Object Heap. If the size is lesser than 85000 bytes, it will be created in a heap called, Smaller Object Heap.When the Garbage Collector collects the objects, it will perform the compaction on Small Object Heap for more contiguous free memory. However, in case of Large Object Heap, it will not perform any compaction, as it takes more resources to move the Large Objects.
Asked In: Many Interviews |
Alert Moderator