.NET Garbagecollector trouble. Blocks for 15-40 mins

前端 未结 2 617
既然无缘
既然无缘 2020-12-30 13:14

Some facts: We have developed wcf service that acts as a layer between clients and the database. It\'s selfhosted and runs as a windows service.

The service keeps s

2条回答
  •  心在旅途
    2020-12-30 13:39

    Excessive garbage collection is often caused by code issues. You either create too many objects in a short time, or you keep allocating memory without releasing it.

    There is actually an extensive checklist available on MSDN that should help you diagnose the problem.

    A very large GC2 means that the objects in there survived multiple garbage collections, which means they are kept in memory for a longer period of time. That could be the root cause of your issue. Maybe there is a caching mechanism that could use some tuning / retention policy (remove data that isn't used for a long time).

提交回复
热议问题