您的位置:首页 > 编程语言 > ASP

教你50招提升ASP.NET性能(十九):静态集合

2013-07-31 13:52 435 查看
(30)Static collections

招数30:

静态集合

If a collection is static, make sure it only contains the objects you need. If the collection is iterated over often, then the performance can be slow if you don’t remove unnecessary objects. Objects in a collection will be held in memory, even if they have been disposed of, which can also lead to a memory leak.
如果一个集合是静态的,确保它只包含你需要的对象。如果集合经常被遍历,如果你不移除不必要的对象,那么性能可能降低。集合中的对象将会占用内存,这也会导致内存泄漏,即时它们已经被处理过。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐