Closed matt454357 closed 9 years ago
It looks like the problem is here: https://github.com/brenkmanco/hackpdm/blob/master/HackPDM_CSharp/MainForm.cs#L517
MainForm.cs -> ResetView():
if (strTreePath == "") {
treeView1.SelectedNode = tnRoot;
PopulateList(tnRoot);
} else {
tnSelect = FindNode(tnRoot, strTreePath);
if (tnSelect != null) {
>-------------------treeView1.SelectedNode = tnSelect;
PopulateList(tnSelect);
} else {
treeView1.SelectedNode = tnRoot;
PopulateList(tnRoot);
}
}
But, I don't understand why this would happen.
I added logic to check if treeVeiw1.SelectedNode was already set to the clicked node, but then I realized that the entire tree is wiped and rebuilt each time, so there is no chance of it already being set to anything except null. Now doing more Google searching to see what else comes up...
On Mon, Jun 1, 2015 at 10:50 AM, Matt Taylor notifications@github.com wrote:
It looks like the problem is here: https://github.com/brenkmanco/hackpdm/blob/master/HackPDM_CSharp/MainForm.cs#L517
MainForm.cs -> ResetView():
if (strTreePath == "") { treeView1.SelectedNode = tnRoot; PopulateList(tnRoot); } else { tnSelect = FindNode(tnRoot, strTreePath); if (tnSelect != null) {
-------------------treeView1.SelectedNode = tnSelect; PopulateList(tnSelect); } else { treeView1.SelectedNode = tnRoot; PopulateList(tnRoot); } }
But, I don't understand why this would happen.
— Reply to this email directly or view it on GitHub https://github.com/brenkmanco/hackpdm/issues/23#issuecomment-107633999.
This issue appears to be what we are experiencing (although it is for an older version): http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.windowsforms.controls/2006-08/msg00266.html
I'd seen something very similar to that reported for a not-so-old version, but I couldn't replicate it on my end, and I haven't found anyone mentioning how to get around it.
Do you think the amount of memory leakage that you're seeing could really be caused by something like this, though? That's a lot of memory being wasted just because the treenodes aren't being garbage collected...
On Thu, Jun 4, 2015 at 2:34 PM, Matt Taylor notifications@github.com wrote:
This issue appears to be what we are experiencing (although it is for an older version):
— Reply to this email directly or view it on GitHub https://github.com/brenkmanco/hackpdm/issues/23#issuecomment-109040832.
Yes. This could easily leak that much memory, if the guy is right. We have 2000 directories. If you refresh the view 3 times, you would be holding 8 billion directories treenodes in memory.
Wow, you weren't kidding that you had a large set of files! That makes sense. I'll keep looking in that direction, then.
On Thu, Jun 4, 2015 at 2:49 PM, Matt Taylor notifications@github.com wrote:
Yes. This could easily leak that much memory, if the guy is right. We have 2000 directories. If you refresh the view 3 times, you would be holding 8 billion directories treenodes in memory.
— Reply to this email directly or view it on GitHub https://github.com/brenkmanco/hackpdm/issues/23#issuecomment-109045472.
I think we're either on the wrong track, or I discovered another issue. There's a problem with the regular expression I'm using to match weird file extension formats. The pattern for the regex grows every time the view is refreshed. I discovered it here: https://github.com/brenkmanco/hackpdm/blob/master/HackPDM_CSharp/FileTypeManager.cs#L470
This appears to fix this issue. At least, I no longer see the symptoms.
After refreshing the view, it starts to gather huge amounts of memory for every operation. Then it cleans up and releases the memory after the operation completes.