Constructor for objects of the OptimizedHolder class.
Constructs an object with the defined number of elements for which memory should be allocated.