Difference between background and concurrent garbage collection?

后端 未结 3 1139
挽巷
挽巷 2020-12-13 02:29

I read that with .NET Framework 4 the current garbage collection implementation is replaced:

The .NET Framework 4 provides background garbage collec

3条回答
  •  攒了一身酷
    2020-12-13 02:53

    The primary benefit will be fewer application freezes due to garbage collection, which in itself could be considered a significant improvement. For most apps this difference will not be noticeable unless you have a HUGE number of long-lived objects in memory.

    This change also makes .NET slightly more viable for building timing-sensitive apps (where response times are important). The extreme example are car airbags - you don't want your software to be busy doing garbage collection when they need to be inflated. The changes in 4.0 reduce the number and length of freezes due to GCing but does not remove them entirely.

提交回复
热议问题