While researching a memory leak, I discovered that this was caused by repeatedly calling NewRow () on a table inside a loop. However, the created DataRow was never added to the table row collection, and the number of rows in the table never exceeded zero.
My question is why does it use more memory every time NewRow is called, although the newly created DataRow is never added to the Rows collection, and the DataRow returned from NewRow is always assigned to the same local variable (thereby, apparently discarding the last new line).
Please ignore the problem why the code creates DataRows that are not added to the table!
source
share