2

Our production repeatedly met "Hashtable insert failed. Load factor too high". 1. How could I simulate this kind of exception? 2. If this sort of exception is thrown, would the existing key/value will disappear?

Thanks for any help.

Ricky
  • 34,377
  • 39
  • 91
  • 131

2 Answers2

2

This contains a relevant explanation: http://blogs.msdn.com/toddca/archive/2007/01/26/hashtable-insert-failed-load-factor-too-high.aspx

Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
1

In .NET 2.0, this error is almost always caused by multiple threads modifying the Hashtable at the same time.

There is a HotFix for .NET 3.5

See Hashtable insert failed. Load factor too high and FIX: "InvalidOperationException, Load Factor Too High" When You Use a Hashtable Collection

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541