EFileTahi-A Posted June 8, 2005 Posted June 8, 2005 (edited) How the Foxtrot can I release the Hashtable's associated resources? I load 30 large bmps which will "eat" about 45MB of ram. Then, If I reload them, an aditional 45MB will be consumed. So, basicaly, If I reload these pictures 5 times more the 200MB will be consumed, even with the myHasTable.Clear() property and the CollectGarbage before reloading these images... Also, the Hashtable don't have the "Dispose()" property... What the... This Hastable of mine is static so I would only like to dispose it's associated resources rather then disposing the object itself... Edited June 8, 2005 by EFileTahi-A Quote
Administrators PlausiblyDamp Posted June 8, 2005 Administrators Posted June 8, 2005 If the objects contained within the hashtable support IDisposable then you could just loop through the items disposing each in turn. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
EFileTahi-A Posted June 9, 2005 Author Posted June 9, 2005 Hi PlausiblyDamp, tks once more for posting out. The objects I am loading into the hastable are "Direct3D.Textures" which do not seem to have any disposing method... So, I have just runned out of ideias... and my project development is now frozen until I walkaround this thing... Any further ideias will be too much apreciated Quote
Administrators PlausiblyDamp Posted June 9, 2005 Administrators Posted June 9, 2005 If they don't have a dispose method then they probably do not need disposing ;) The only time an object needs to provide a Dispose method / have a dispose method called is if it has any unmanaged resources (windows handles, db connections etc.). If there are no unmanaged resources and the object doesn't provide a dispose method then just set them to null or let them fall out of scope and the GC will reclaim them when it sees fit. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
HJB417 Posted June 9, 2005 Posted June 9, 2005 Texture.Dispose Hi PlausiblyDamp, tks once more for posting out. The objects I am loading into the hastable are "Direct3D.Textures" which do not seem to have any disposing method... So, I have just runned out of ideias... and my project development is now frozen until I walkaround this thing... Any further ideias will be too much apreciated Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.