但string又是个特殊的类,有可能有什么缓存之类的东西就不晓得了 ------解决方案-------------------- 不会回收的。参见《CLR via C#》一书的说明:
A static field keeps whatever object it refers to forever or until the AppDomain
that the types are loaded into is unloaded. A common way to leak memory is to have a
static field refer to a collection object and then to keep adding items to the collection object. The static field keeps the collection object alive and the collection object keeps all its
items alive. For this reason, it is best to avoid static fields whenever possible.