I am running a fairly large search, and am getting a System.OutOfMemoryException.
The problem is I am storing a string key for each state I have previously visited as a HashSet<sting>
. Once this gets to around 7 million elements, it crashes. My thought is that I don't need to be able to retrieve the strings, only recognize if it exists in the set.
I seem to remember a specialized data structure for this kind of thing, but I can't remember the name of it for the life of me. If I recall correctly it had fairly constant memory requirements and you add elements to it, and it can tell you with some degree of certainty whether you have already added some value to it. Am I making this up, or does this exist. Any tips?