Before starting to decode big image, try to estimate the needed memory and check if such memory is available using the MemoryFailPoint class. The behavior in case of failure in printing scenarios should be considered carefully. The user should be able to turn the behavior on and off.