![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm trying to locate a memory leak.. I've a test app which creates an instance of a big class, null's the reference, then calls GC.Collect() a few times in an attempt to clean up any memory. Thus, in thory, I don't think my instance should exist anymore. I use SOS (within the IDE): !name2ee gives me the method table for my class !dumpheap -mt xxx -> lists the object instance that I think should have be GC'd then !gcroot <instance address> to look to see what's still holding it. The only root displayed starts: DOMAIN(0014C278):HANDLE(WeakSh):9f127c:Root:014153 8c (MyNamespace.SomeOtherClass)- which I thought meant that this was a weak handle that won't be keeping the instance alive. Am I misunderstanding how gcroot works? If I then "!gcroot 0141538c" I get a pinned object[] root (which is probably the overall cause of the problem, therefore), but why doesn't this one show up when I gcroot the original class instance? |
#3
| |||
| |||
|
|
I'm trying to locate a memory leak.. I've a test app which creates an instance of a big class, null's the reference, then calls GC.Collect() a few times in an attempt to clean up any memory. Thus, in thory, I don't think my instance should exist anymore. I use SOS (within the IDE): !name2ee gives me the method table for my class !dumpheap -mt xxx -> lists the object instance that I think should have be GC'd then !gcroot <instance address> to look to see what's still holding it. The only root displayed starts: DOMAIN(0014C278):HANDLE(WeakSh):9f127c:Root:014153 8c (MyNamespace.SomeOtherClass)- which I thought meant that this was a weak handle that won't be keeping the instance alive. Am I misunderstanding how gcroot works? If I then "!gcroot 0141538c" I get a pinned object[] root (which is probably the overall cause of the problem, therefore), but why doesn't this one show up when I gcroot the original class instance? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |