EldoS | Feel safer!

Software components for data protection, secure storage and transfer

(.NET) Memory usage in my project grows all the time and this is due to SecureBlackbox. Why?

.NET memory management is efficient for most purposes but not ideal. If you create the objects and let them live in memory, they are collected. Later. When the system starts to run out of memory. Until then the objects just pollute memory.

You can help the memory manager and garbage collector by explicitly disposing of the objects that you no longer need. To let you do this most of SecureBlackbox objects support IDisposable interface and Dispose() method. So what you need to do is (a) call .Dispose() method on every object that you want to dispose, and (b) set the object's variable to null/Nothing after a call to Dispose().

You don't need to call Dispose() of inner objects owned by container classes. Eg. if you add a certificate to the certificate storage, the storage class will make an internal copy. You don't need to dispose of those internal copies (the container class will do this for you) yet you will need to dispose of the certificates you added yourself, as they are not referenced in the storage class.

After you call Dispose() method, the object can not be used anymore, even when you have a reference (or several references) to this object. So you need to ensure that you dispose of the object only when it's really not used anymore.

Return to the list


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!