How should I deal with a very large array in Java?

前端 未结 7 1792
情深已故
情深已故 2021-02-04 13:48

I have an algorithm which currently allocates a very large array of doubles, which it updates and searches frequently. The size of the array is N^2/2, where N is the number of

7条回答
  •  爱一瞬间的悲伤
    2021-02-04 14:29

    You can try storing the array as rows in a database table and use stored procs to do updates and searches on it.

    Another Idea:

    Use a B-Tree as your array and keep some leaves on disk. Make sure and make the nodes of the B-Tree the size of a page or the size of multiple pages.

提交回复
热议问题