In [[computer science]], '''coalescing''' is athe partact of [[memory management]] in whichmerging two adjacent free blocks of [[computer memory]] are merged. When a[[Computeran program|program]]application no longer requires certain blocks offrees memory, thesegaps blockscan offall memoryin can bethe [[Free a memory ___location|freedsegment]].Withoutthat coalescing,the theseapplication blocksuses. of memory stay separate from eachAmong other in their original requested sizetechniques, evencoalescing ifis they are nextused to eachreduce other.[[Fragmentation If(computer)|external afragmentation]], subsequentbut requestis fornot memorytotally specifieseffective. aCoalescing size of memory that cannotcan be metdone withas ansoon integeras numberblocks of the (potentially unequally-sized)are freed blocks, theseor neighboringit blocks of freed memory cannotcan be allocateddeferred foruntil thissome request.time Coalescinglater alleviates(known thisas issuedeferred by setting the neighboring blocks of freed memory to be contiguous without boundariescoalescing), such that part or allit ofmight it cannot be allocateddone forat the requestall.
Among other techniques, coalescing is used to reduce [[Fragmentation (computer)|external fragmentation]], but is not totally effective. Coalescing can be done as soon as blocks are freed, or it can be deferred until some time later (known as deferred coalescing), or it might not be done at all.
Coalescence and related techniques like heap compaction, can be used in [[Garbage collection (computer science)|garbage collection]].