scala-offheap icon indicating copy to clipboard operation
scala-offheap copied to clipboard

Consider adding support for off-heap vectors

Open densh opened this issue 9 years ago • 4 comments

Continuos arrays are not a perfect match for paged regions (due to maximum allocation size restriction.) To make it easier to work with collections of data in regions we can introduce a different collection (e.g. Vector) that stores data in linked (potentially tree-based) groups of small arrays that fit well in pages.

densh avatar Mar 17 '15 20:03 densh

Another idea: Instead of making arrays more complicated we can just allocate larger arrays directly from system memory and free them once region ends. This would put them on slow path but won't require users to specially structure their code to fit into region page system.

densh avatar May 20 '15 12:05 densh

Yet another idea: Use variable-size pages in memory pooling layer. This way region can just request for page as big as necessary to allocate large array.

densh avatar May 21 '15 08:05 densh

allocate larger arrays directly from system memory and free them once region ends

By doing this you're just offloading the same problem to OS allocator. It's likely to be more capable of solving it, but the problem still persists.

DarkDimius avatar May 21 '15 09:05 DarkDimius

Another use-case: efficient implementation of size-changing operations on arrays like filter as discussed in https://github.com/densh/scala-offheap/issues/39#issuecomment-122563866

densh avatar Jul 19 '15 11:07 densh