Memory issue regarding UIImageView on IPhone 4.0 / IPad
- by Sagar Mane
Hello All,
My Application is crashing due to low memory [ Received memory warning level 1 + 2]
To trace this I have used Instrument and come with following points
Test Enviorment : Single view controller added on Window
When I don't use UIImageView Real Memory is used 3.66 MB
When I uses UIImageView with Image having size 25 KB : Real Memory is used 4.24 MB. almost 560 KB extra when compare to w/o UIImageView and which keep on adding as I am adding more UIImageview on the view.
below is sample code for adding UIImageview which I am refering
UIImageView* iSplashImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default-Landscape.png"]];
iSplashImage.frame = CGRectMake(0, 0, 320, 480);
[self.window addSubview:iSplashImage];
AND
dealloc
if(iSplashImage)
{
[iSplashImage release];
iSplashImage = nil;
}
Issue is this 560 KB is not getting release and after some time application receives low memory warning.
Can anyone point out if I am missing something or doing else. As My application uses lots of Images in One session.
Thanks in Advance,
Sagar