C# dictionary - how to solve limit on number of items?

后端 未结 8 804
不知归路
不知归路 2020-12-21 03:54

I am using Dictionary and I need to store almost 13 000 000 keys in it. Unfortunatelly, after adding 11 950 000th key I got an exception \"System out of memory\". Is there a

8条回答
  •  轮回少年
    2020-12-21 04:28

    With that many keys, you should either use a database or something like memcache while swapping out chunks of the cache in storage. I'm doubting you need all of the items at once, and if you do, there's no way it's going to work on a low-powered machine with little RAM.

提交回复
热议问题