I am writing an application that should contain about forty-44 kb JPEG in memory at once. I heard that applications can use about 22 megabytes before triggering a low memory warning, so I'm sure he can do it. However, as soon as I go through the downloaded megabytes, these messages begin to appear in the console:
Mon Jun 8 16:37:19 unknown configd [21]: kernel memory event (90), free: 374, active: 1736, inactive: 959, purgeable: 0, wired: 6260
Mon Jun 8 16:37:20 unknown configd [21]: kernel memory event (95), free: 363, active: 876, inactive: 492, purgeable: 0, wired: 6241
Mon Jun 8 16:37:20 unknown SpringBoard [22]: Memory level is critical (5%). No apps to kill. Will kill SpringBoard
Mon Jun 8 16:37:24 unknown SpringBoard [22]: Jetsaming SpringBoard ...
Then it brings me back to the main screen.
Here is the code I use to upload images:
#define NUM_IMAGES 40
@interface MyClass : NSObject {
UIImageView* imageView;
UIImage* loadedImages[NUM_IMAGES];
}
- (void)initImages;
@property (nonatomic, retain) IBOutlet UIImageView* imageView;
@end
@implementation MyClass
@synthesize imageView;
- (void)initImages {
int i;
for (i = 0; i < NUM_IMAGES; i++) {
loadedImages[i] = [UIImage imageNamed:[NSString stringWithFormat:IMAGE_FORMAT, i+1]];
}
imageView.image = loadedImages[0];
}
@end
Am I doing something wrong here? Can iPhone apps use only megabytes of memory?
Eoghan underwood
source
share