How can I use the garbage collector?

Not knowing about the GC and not having to use it (or so I think), which is typical for use, and how can I use my system if I die and learn more about the GC

UPDATE ... how can I facilitate the work of the GC?

+3
source share
10 answers

UPDATE ... how can I make things easier for the GC?

The easiest way to make the GC easier is to let it work without interference. It is optimized when it needs to run it by itself.

I would see when to use Finalizer in C #. This is one area where you can potentially help the GC.

Big Object Heap , .

http://techiemate.blogspot.com/2009/04/garbage-collection-in-net.html

+3

GC - CLR .

+14

- ...

!

. , GC, " ", .

+2

GC , ++. . GC , . , /, .

+1

GC, Dispose() , IDisposable.

+1

GC:

  • , , . , , , Disposed .

  • , . , pinning / GC.KeepAlive, GC , . , GC.

  • . , , IDisposable, GC.SuppressFinalize(this) , GC .

+1

, GC, , .

GC , .

0

, ; .

( , ), IDisposable pattern, , ( " ", , ).

0

, C, , , , , , . , , .

- , . , , "" : , . , .

"", - - , "", . , , , , . , , , , ​​ null (Nothing VB). , "" , . - , , , .

0

GC ( ), , , GC

, , .

UPDATE... GC?

, . , . , .

0

Source: https://habr.com/ru/post/1753318/


All Articles