Found a really nasty memory leak in UltraGridRow
. There is this code in our application that has to export Infra's Ultra Grid data to a csv file, its fairly simple, for each row the developer goes through all its non-hidden colums, gets the value from the cell, and appends it into the StringBuilder, which in the end is dumped into a file. During testing the test guy reported that he was exporting data from the grid that has 3000 columns, and around 1000 rows, ultra grid shows the data just fine, no problems there, but when we enumerate all its rows and get all its values, the application goes out of memory and crashes. Upon a lot of debugging of carefully using stringbuilers, strings, streamwriters, filestream, I found out that it was just the "gridrow.Cells[z].Value.ToString()" that was the cause of memory leak, and no kind of GC Collects were able to solve this problem.
The resolution of it was that instead of getting values directly from the cells, I took a reference of the grid's DataSource property as it was a DataTable, and through this dt I got the strings that I wanted to write to the file. Problem was solved, I tested with 10000 rows with 3000 columns, no out of memory problems.