弱引用特别适合以下对象:占用大量内存,但通过垃圾回收功能回收以后很容易重新创建。
Weak references are useful for objects that use a lot of memory, but can be recreated easily if they are reclaimed by garbage collection.
引用类的主要功能就是能够引用仍可以被垃圾收集器回收的对象。
The main feature of the reference classes is the ability to refer to an object that can still be reclaimed by the garbage collector.
若在一个含有垃圾回收器功能的活动堆栈上发生崩溃,应查询代码中的PInvokes函数,查是否因缓冲区太小而发生穿越行为。
If you get a crash and the top of the active stack contains a GC function, start looking for PInvokes in your code and see if you might be passing buffers that are too small.
应用推荐