Java NIO MappedByteBuffer OutOfMemoryException

前端 未结 4 1470
孤街浪徒
孤街浪徒 2020-12-15 01:34

I am really in trouble: I want to read HUGE files over several GB using FileChannels and MappedByteBuffers - all the documentation I found implies

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-15 02:09

    The bigger the file, the less you want it all in memory at once. Devise a way to process the file a buffer at a time, a line at a time, etc.

    MappedByteBuffers are especially problematic, as there is no defined release of the mapped memory, so using more than one at a time is essentially bound to fail.

提交回复
热议问题