ngageoint / tiff-java

Tagged Image File Format Java Library
https://ngageoint.github.io/tiff-java
MIT License
72 stars 34 forks source link

Android OutOfMemoryError occurs when readTiff for 400MB tif file #31

Closed songhu42 closed 3 years ago

songhu42 commented 3 years ago

Please fill out as much known and relevant information as possible.

Version Information:

Expected Results:

Output:

Relevant Code:

// Code to reproduce the problem?
TIFFImage tiffImage = TiffReader.readTiff(tiffFile);

Test Files:

Additional Information:

bradh commented 3 years ago

Can you provide file(s) that demonstrate the problem? Even the results of a gdalinfo dump may help.

Also, what do you have set for your Dalvik heap size to?

bosborn commented 3 years ago

This implementation loads the entire tiff file into memory for raster random read access. Your reported error occurred attempting to copy the file into memory. Allocation of ~537mb with a growth limit of ~537mb.

Try increasing the heap size.