tags:

views:

238

answers:

1

Hi,

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

+1  A: 

AFAIK Value types are put on the stack, reference types are put on the heap. Once you go "out of scope" releasing value types (i.e. 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.

Jeroen Landheer
I will carefully read the article.
pablo