Can you search in current project and all referenced projects within solution?

71 views Asked by At

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

There are 2 answers

1
mtijn On

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.

0
kodefuguru On

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