I want to use the Ocaml array instead of list because the memory footprint for array is less than the list.
I have to store big information in array. I am using Array.append to add a new element.
However, Ocaml documentation for
Array.append v1 v2
returns a fresh array containing the concatenation of the arrays v1
It returns a fresh array without modifying the existing array.
After appending many items in the array, array.ml append function throws Out-of_memory error.
Is there any other alternative to this function? [Or perhaps my understanding of Array module is not good]
Thank you in advance.