In .NET, there is a constructor for Dictionary that takes one parameter, int capacity. This is the same as with many other collecti
Dictionary
int capacity
By 2019, .Net Standard 2.1+ and .Net Core 2.1+ implement Dictionary.TrimExcess():
Dictionary.TrimExcess()
see: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.trimexcess?view=netstandard-2.1
.Net Framework doesn't implement it in any version.