在
another question,Stephen C说:
A second concern is that there are
runtime overheads with using weak
references. The obvIoUs costs are
those of creating weak references and
calling get on them. A less obvIoUs
cost is that significant extra work
needs to be done each time the GC
runs.
那么弱参考的GC的成本到底是多少?它需要做多少额外的工作,以及它有多大的交易?我可以做一些有根据的猜测,但我对实际的机制很感兴趣.
解决方法
请查看杰弗里里希特关于
Memory Management in .NET的文章,它必须清理一下.