Good morning SO,
I have a class that contains the following static array:
public static ResultObject[] ResultArray = new ResultObject[500];
In my program, there are 12million instances of this class that all add to this array. I'm getting a OutOfMemoryException and think this might be the reason why.
Is there any way I can manage the memory being used by this array better so I won't get this exception? If not, which is faster, writing to a file or database?
I'd prefer to hold this data in memory, but if that is the cause of my problem, then I'll have to try something else.
Thanks!