Is this indicated in the documentation for the class? No, then it is not indicated.
Regarding the current implementations, the classes themselves do not have a maximum size in RAM, if you create a value type whose size is 2 MB, click a few thousand in the list and get an exception in memory, which means nothing to do with List<T> .
Inside, a List<T> output would prevent her from having more than 2 billion items. Itβs more difficult to answer Dictionary<TKey, TValue> , since the method of positioning inside it is more complicated, but in fact, if I were looking for processing a billion elements (if, for example, a 32-bit value, then 4 GB), I would like to save them in the database and get them using the data access code.
At least once you are dealing with a single data structure that is 4 GB in size, rolling your own custom collection class is no longer considered a wheel reset.
Jon hanna
source share