简体   繁体   中英

.NET CLR Memory\% Time in GC

I'm testing an app that reads thousands of small objects and sends then back to the client through remoting.

Using ProcessExplorer from SysInternals I see the ".NET CLR Memory\\% Time in GC" is bigger than 50% under heavy load.

  • Does it mean 50% or even more of the time is being spent on the GC?

  • If so, how can I improve performance? An obvious answer is: not creating so many objects but, how can I do that? Would "structs" work better?

Thanks

AFAIK Value types are put on the stack, reference types are put on the heap. Once you go "out of scope" releasing value types (ie structs) is a lot faster than releasing objects on the heap (these are GC-ed).

About the %time in GC, take a look here

Hope this helps.

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