Maximum Number of Elements per Array
recently I stumbled over the problem of exceeding the maximum number of elements in an array. Currently I am finalizing a new open source software for segmenting & visualizing 3D (medical) volume data. When trying o allocated data for a volumetric data set of 1024x1024x2048 entries in a one dimensional int array, I got the error of trying to allocated a negative array size, as the number is obiousely a (signed) int and not a long.
I know a couple of workarounds for this, being either very technical or time expensive. So here are my questions:
a) Is there any chance that an upcoming java version will get bigger arrays? In times of 64 bit operating systems this might be necessary more often in close future.
b) Elsehow I would write the whole datastructure in C++ and use JNI to get it into the program ... does this sound like a good idea? I would like to avoid that since everything is done in pure Java so far.
c) Does anyone know a good alternative? Splitting the grid data into two halfes is not an option as I defenitely need to avoid the extra "if (upper_half)" in every voxel access.
PS: Not sure if this is the right branch of the forum, but I'll give it a try! If not, please let me know where to post instead!