Reply To: Error: java.lang.NegativeArraySizeException

Activity Forums Astrosoftware Astro Pixel Processor Error: java.lang.NegativeArraySizeException Reply To: Error: java.lang.NegativeArraySizeException

#15113
Haverkamp
Participant

Hi Wei-Hao (@whwang)

I have added several extra checks for memory or technical limits into APP.

A proper message will pop-up, when image dimensions become infinite or negative, like the error that started this thread.

If your image dimensions after registration become bigger than

1) the amount of memory  that can be allocated or

2) the technical limit of the image structure in the code

the user will get a warning that the image will be downscaled with a certain factor

and the warning will indicate which limitation was reached.

The downscaling is a measure that although a limit is reached, the image can still be created.

I have been testing this, this afternoon.

With 16GB of memory allocated for APP the limit is a

430MP (MegaPixel) 32bits float RGB image, so a monochrome 32bits image could be 3times this, 1290 MP. This 430MP  image has 25000×17000 image dimensions and is 5GBs large.

To make bigger pictures, more memory needs to be allocated to APP.

The technical limit for an image would be triggered when the

– RGB image becomes larger than (2^31) / 3 = 700MP

– monochrome image becomes larger than 2^31 = 2147MP

For 32bits float data, this means that allocating 32GBs of RAM to APP is enough. Allocating 80GBs of RAM won’t accomplish more.

To go beyond the 2 billion pixel limit, I would need to completely rebuild the way APP handles images. This would be something to implement once other more pressing matters are solved off course.

I will compile new versions later today and will inform you once they are ready for download.

(The screenshot shows the warning when a limit is reached, I set the technical limit really low for testing purposes.)

Scroll to Top