Another Stupid Question
Date: 02/14/08
(C Sharp) Keywords: no keywords
I have another quick stupid question.
I thought that setting an object to null in C# will effectively destroy that object and free up the memory it used. However, in practice it doesn't seem to be doing anything.
As I have mentioned before in previous posts, I'm working on an IRC chatterbot. Right now I have three different "brains" that will help the bot talk to people. The first I implemented was AIML. However, I've since told it not to load that one by default because of the massive amounts of RAM it requires (65MB). I've got a toggle that tells it to create the AIML object, which in turn loads all the AIML files necessary, when the user wants to turn on that particular mode. Toggling it a second time should destroy that object, but checking the memory in use it still shows that toggling it off doesn't free anything.
Is there something special I have to do in addition to setting the object to null in order to force the RAM to be freed?
Source: http://community.livejournal.com/csharp/93105.html