Monday, 22 December 2014

ASP.NET Tips #5 - Avoid using static collections

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.

No comments :

Post a comment