Array which Pages to Disk

前端 未结 3 793
我寻月下人不归
我寻月下人不归 2021-02-11 00:30

Does anyone know of a .NET array class/library which will page its contents out to disk?

The idea is to be able to use it as a normal array but the class uses less RAM

相关标签:
3条回答
  • 2021-02-11 00:40

    Unless you're dealing with fixed length records (and even then there's issues) you're going to run into a lot of problems with treating 2GB of data like an array that make a lot of array uses perform horribly -

    • IndexOf()
    • InsertAt()
    • RemoveAt()
    • Sort()

    Is there any reason a database wouldn't work?

    0 讨论(0)
  • 2021-02-11 00:44

    I found this solution in VB of a file-based array: http://www.vbforums.com/showthread.php?t=504649

    But it seems hacky... Still looking for another implementation.

    0 讨论(0)
  • 2021-02-11 00:49

    I haven't come across anything like that, but I guess that's because it's rarely needed. After all, a database table (in SQL Server or any other database) is in essence a disk-based array.

    You could write an IList<> wrapper around a database table. Throw in some caching and you have a perfect disk-based array.

    0 讨论(0)
提交回复
热议问题