0

I have some memory leaking. I am creating a big object graph and then derefencing it.

 var a = MyDomainModel.Create();
 a = null;
 //GC.Collect();
 Console.ReadLine();

There is no unmanaged stuff in there. JustTrace and ANTS (version 6) are both reporting that the objects are held in place by "System.Object[]". I am assuming that there is a static field (list/dictionary/hashset) hidden somewhere that is using an ArrayList internally. I am planning to do a bit of text searching (probably some regex in there, too). It is a pretty big solution with 30 projects. Is there any way I can do Visual Studio text search in "current project and all projects within the solution that are referenced directly/indirectly by current project"? The underlying physical file folders are not organized in a way that would meaningfully represent these dependencies.

2 Answers 2

1

if you're using Windows 7, create a library and add your project locations to the library. that should get them all organized in one place without actually moving or copying anything. then from Visual Studio do a text search in the library folder.

1
  • I suppose I can browse the assembly, locate the projects and create a library. There is some overhead, but thus far the best solution. Thanks.
    – Tormod
    Aug 14, 2012 at 9:02
0

I assume issue has already been solved. If anyone else is experiencing something similar, JustTrace now handles this scenario through the Root Path view. Here are several paths to it.

  1. Largest Memory Retainers: Find one of the objects being held in memory by object[]. Select the object, then click the Root Paths button in the ribbon.

  2. By Type: select the type then click the Instances button in the ribbon. Select one of the instances, then click Root Paths.

  3. Incoming References by Type: select the type, then click the Instances button in the ribbon. Select one of the instances, then click Root Paths.

The root paths graph shows the member name holding the instance and marks fields/properties that are static. See the image below for an example.

root paths with static

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.