简体   繁体   中英

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

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.

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.

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.

静态的根路径

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM