I found a suspected memory leak problem, as shown in the following code(COMAddin Ribbon):
public void btnGetValue(Office.IRibbonControl control)
{
var wbk = Application.ActiveWorkbook;
var wsh = wbk.Sheets[1] as Excel.Worksheet;
for (int j = 0; j < 10; j++)
{
for (int i = 1; i <= 10000; i++)
{
Console.WriteLine(wsh.Range("A"+i).Value.ToString());
}
}
MessageBox.Show("OK");
}
Memory usage will continuous increase, I suspect there is a memory leak.
Could you please analyze it for me?
Thanks!
Hi @susson, I recommend the ReSharper dotMemory tool to analyze memory leaks. It will show you detailed data where the allocations come from and which objects are held in memory.
Hello,
I found a suspected memory leak problem, as shown in the following code(COMAddin Ribbon):
Memory usage will continuous increase, I suspect there is a memory leak. Could you please analyze it for me? Thanks!