A resizable array using non-sequential block memory allocation. Growing or shrinking the array does not require reallocation of the entire array. Useful when you need to track a few trillion data points.
Note: For best results a 64-bit system and enough RAM to hold your data is recommended. If your data set grows slowly over time, paging to virtual memory may be acceptable.
npm install big-array
Usage: bigArray.Char(numberOfInitialElements, sizeOfElementBlocks)
var bigArray =ba val;// Numeric array typesba = 10 100;ba = ;ba = ;ba = ;ba = ;ba = ;ba = ;ba = ;ba = ;ba = ;
Tip: When testing on Linux, use "ulimit -v" to limit the maximum memory consumption.
# Limit memory usage to 10GBulimit -v 10485760
// inc/dec by 1// modify push/pop index// resize array to [size]