I have written a text editor that sorts lines, I plan to use it with some large files. say about a million lines, ranging between 10 and 75 MB. I am currently testing my app using about a 50mb file with about 900,000 lines. the program adds all the lines from the text box to an array and sorts them, then writes them back, sorted, to the text box. it also copies the text box to a stack for an undoer. other sort methods in my program create multiple arrays and use one as a key to sort the other, and the slowest sorting method using an IComparer class to sort in natural order.
my dilemma is that I get OutOfMemoryExceptions frequently. I have read up the best I could and I don't understand what to do about it. all I can find is something about the compact framework and 64K methods, but Im not using the compact framework. is there something I can do to better handle the large files. is there a better way to implement and undoer, or would dropping the undoer really fix the problem?
what is there to do about this error?