TableRowCollection.TrimToSize Method


Optimizes memory consumption for the collection by setting the underlying collection Capacity equal to the Count of items currently in the collection.

 void TrimToSize();
public void TrimToSize ();
member this.TrimToSize : unit -> unit
Public Sub TrimToSize ()


This method can be used to minimize memory overhead for a collection, particularly if the set of items contained by the collection is expected to be static.

Applies to