title: Data structure for recognizing repeat values
body: <p>I am running a fairly large search, and am getting a System.OutOfMemoryException.</p>
  
  <p>The problem is I am storing a string key for each state I have previously visited as a <code>HashSet&lt;sting&gt;</code>. 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.</p>
  
  <p>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?</p>