Hi,
I am trying to load a lot of images - with the inevitable result that the app crashes due to 'out of memory'.
try/ catch does not catch the error, the app just crashes.
Is there any way to check the memory available so that I can take action to avoid the crash?
OS.setLowMemory, OS.AvailableExternalMemorySize and OS.AvailableInternalMemorySize do not help.
I'm assuming that the 'out of memory' refers to RAM(DDR) memory. Can I check now much of that is available/ free somehow?
Initializesample doesn't help. If I use it I get:
.........
62: IMAG0069.JPG
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory: 8
Downsampling image due to lack of memory: 16
63: IMAG0070.JPG
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory: 8
Downsampling image due to lack of memory: 16
Downsampling image due to lack of memory: 32
java.lang.RuntimeException: Error loading bitmap (OutOfMemoryError)
........
in debug mode
Thanks
I am trying to load a lot of images - with the inevitable result that the app crashes due to 'out of memory'.
try/ catch does not catch the error, the app just crashes.
Is there any way to check the memory available so that I can take action to avoid the crash?
OS.setLowMemory, OS.AvailableExternalMemorySize and OS.AvailableInternalMemorySize do not help.
I'm assuming that the 'out of memory' refers to RAM(DDR) memory. Can I check now much of that is available/ free somehow?
Initializesample doesn't help. If I use it I get:
.........
62: IMAG0069.JPG
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory: 8
Downsampling image due to lack of memory: 16
63: IMAG0070.JPG
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory: 8
Downsampling image due to lack of memory: 16
Downsampling image due to lack of memory: 32
java.lang.RuntimeException: Error loading bitmap (OutOfMemoryError)
........
in debug mode
Thanks