My application using ARC does the following:
- Uploads a picture taken by the camera.
- Compresses an image for use as a thumbnail.
- I do this using [UIImage imageWithData: UIImageJPEGRepresentation (original, 0.1f)]
- I set an uncompressed image link to nil for ARC to free up memory
Repeating this sequence will mean that several compressed thumbnails are displayed on the screen. After about 7 or 8 snapshots, the application crashes due to low memory.
In Tools, I try to use Allocations in tandem with Memory Monitor to find the source of my problem.
Statistics of some tools:
Highlight - Live Bytes jumps about 2 MB after shooting, but then decreases by 1.5 MB after the original image link is set to zero. It seems good, but ...
Here is the possible state of the application. #Living seems very high relative to Live Bytes, right?
Live Bytes #Living #Transitory Overall #Overall Bytes 3.72 MB 24538 80679 90.1 MB 105301
Memory monitor (tracking monitoring head). My application starts with 7.5 MB, and with one shot, an increase of ~ 13 MB is obtained. For the state that I listed above, Memory Monitor says that the application occupies 72.67 MB of βReal memoryβ and 123.79 MB of virtual memory.
Given that Live Bytes are very small, I know that I am doing something right. However, given that the amount of memory in other places is large, I am also sure that I am doing something very wrong. Any ideas what this might be, or how to track it?
source share