小的初始堆通过鼓励收集器尽早执行紧凑排列来降低碎片率。当堆很小时,紧凑排列成本很低。
Small initial heaps reduce fragmentation by encouraging the collector to perform compactions early, when the heap is small and the cost of compaction is lower.
G1通过有效的压缩完全避免了对细微空闲内存空间的分配,这不仅大大简化了收集器,而且还消除了潜在的碎片问题。
G1 compacts sufficiently to completely avoid the use of fine-grain free lists for allocation, which considerably simplifies parts of the collector and mostly eliminates potential fragmentation issues.
gencon 策略使用一个复制收集器有效地紧凑排列会给每个收集带来负作用的婴儿(nursery)区域,从而避免碎片的产生。
The gencon policy avoids fragmentation by using a copying collector that efficiently compacts the nursery area as a side-effect of every collection.
应用推荐