I have an application that processes a large number of small objects, for example. 2000 messages per second. One message is approximately 100 bytes, and maybe less. The application was run for 6 and a half hours under load, and during this time he had collections of 264,416 0 th , 166,699 1 st gen and 69,608 2 nd gen. These are 11.6, 7.3 and 3 collections per second, respectively.
The question is how to make garbage collection less frequent?
UPD: An application is a server that receives messages from WCF using several processing modules and storing them in a database.
I got the impression that the GC should adapt and increase the size of the generation after a while, but this is clearly not the case.
UPD 2 : as suggested by leppie GC in server mode, it really makes the collection 10 times smaller. It also appears (as Richter describes) that frequent collections are not so bad.
zzandy
source share