Вопрос

I understand that only way a .NET application ( that does not use any unamanged code) can cause memory fragmentation is by large object heap. Are there any ways of detecting if your application is fragmenting memory and anyways of avoiding it?

Это было полезно?

Решение

  1. Keep objects small.
  2. Keep objects short-lived.
  3. Trust the GC

1 and 2 might be tough in practice but honestly, you'd be talking about BIG objects and the GC really does a good job with all this.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top