allocation

Reserving memory for a new object on the heap.

In more detail

Each allocation must later be reclaimed by the garbage collector, so needless allocations in hot code cost time. Boxing, string concatenation in loops and Task objects are common sources.

Related terms

Taught in

References