How can we predict or calculate the max number of object a list can contains List<Model>
in c#? A model has many attributes like string int double float compostiedatatype.
if we have a List<int>
it is simple straight forward it's max size is 2^32, what if the object is composite data type? should we calculate the byte of each property of model and it sum it?
object
{
int byte
double byte
string byte
}
size of object is = calculate(add each byte of property) ??
what is the max limit of data into list<string> in c#?
EDIT What i can say from the below code?
While(true)
{
try
{
listModel.add({add model});
}
catch(Exception overflow)
{
listModel.Count();
}
}
If the count is 32 so i can predict the list can contain only 32 objects?
Why i am wondering about memory
Should i care about memory, assume i have a list of objects in memory every time the user inserted we insert the data in to the list i am wondering is there a point where my application will collapse? Should i reconsider my approach? In memory data has fast retrieval time like dictionary retrieval time is O(1).??