CSHARP_INTERVIEW_LIB Telegram 836
Долгоживущий .NET-сервис постепенно “распухает” по памяти без явных LOH-пиков. В дампе видно множество делегатов/лямбд, Timer и CancellationTokenRegistration, висящих в Gen2. Как диагностировать и устранить утечки из-за событий/таймеров/регистраций?

Проанализировать пути до корней (dotMemory/PerfView/dotnet-dump gcroot) — проверить коллекции подписчиков и списки делегатов у источников событий. Убедиться, что:

✍🏻 все подписки снимаются в Dispose/IAsyncDisposable;
✍🏻 CancellationToken.Register хранит IDisposable и корректно Dispose();
✍🏻 Timer/PeriodicTimer/System.Threading.Channels закрываются/завершаются;
✍🏻 не удерживаются замыканиями большие объекты/this.

При необходимости — слабые события/WeakReference, паттерн “own the lifetime”, и тест “утечек” в CI с сравнением heap-снимков.


Библиотека собеса по С#



tgoop.com/csharp_interview_lib/836
Create:
Last Update:

Долгоживущий .NET-сервис постепенно “распухает” по памяти без явных LOH-пиков. В дампе видно множество делегатов/лямбд, Timer и CancellationTokenRegistration, висящих в Gen2. Как диагностировать и устранить утечки из-за событий/таймеров/регистраций?

Проанализировать пути до корней (dotMemory/PerfView/dotnet-dump gcroot) — проверить коллекции подписчиков и списки делегатов у источников событий. Убедиться, что:

✍🏻 все подписки снимаются в Dispose/IAsyncDisposable;
✍🏻 CancellationToken.Register хранит IDisposable и корректно Dispose();
✍🏻 Timer/PeriodicTimer/System.Threading.Channels закрываются/завершаются;
✍🏻 не удерживаются замыканиями большие объекты/this.

При необходимости — слабые события/WeakReference, паттерн “own the lifetime”, и тест “утечек” в CI с сравнением heap-снимков.


Библиотека собеса по С#

BY Библиотека собеса по C# | вопросы с собеседований


Share with your friend now:
tgoop.com/csharp_interview_lib/836

View MORE
Open in Telegram


Telegram News

Date: |

With the sharp downturn in the crypto market, yelling has become a coping mechanism for many crypto traders. This screaming therapy became popular after the surge of Goblintown Ethereum NFTs at the end of May or early June. Here, holders made incoherent groaning sounds in late-night Twitter spaces. They also role-played as urine-loving Goblin creatures. “Hey degen, are you stressed? Just let it all out,” he wrote, along with a link to join the group. A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first. Hashtags are a fast way to find the correct information on social media. To put your content out there, be sure to add hashtags to each post. We have two intelligent tips to give you: Healing through screaming therapy
from us


Telegram Библиотека собеса по C# | вопросы с собеседований
FROM American