I'm seeing what looks like a leak with Hashtable, but guessing it is
something I'm doing -
void func1()
{
Hashtable hash = getHash();
//Loop thru assorted data, check to see if data exists as key in
hashtable.
hash.Clear();
hash = null;
}
Hashtable getHash()
{
//populate and return new hashtable...
}
The memory consumption (found with GC.GetTotalMemory(false) ) keeps on
rising after each call to func1(), even though I've cleared the hash. Is
there something else I need to do? If I don't create and check the hash
keyset, memory consumption stays very low.
And, I am using the hash simply as a fast reference comparison,
if(hash.containskey("key I'm looking for")) kindof logic, all I really want
is the keyset but couldn't find a way to do that. The hash will sometimes
be loaded with *lots* of keys. I tried arraylist and the contains method,
but that was way to slow.
Thanks in advance!
Derrick