In Xcode and Instruments
I see UILabel (CALayer)
using large amounts of virtual memory (Anonymous VM). I see about 235 KB of virtual memory per UILabel
.
I think this perhaps is a new issue with iOS 7.1 or 7.1.1.
Is this expected?
I created a simple program that creates 500 UILabels
and Instruments
shows 115MB of memory used. At about 1500 labels the application is terminated by the OS.
for (int i = 0; i < 500; i++)
{
index = (int)[self.items count];
index++;
frame = CGRectMake(10.0, 20, 300.0, 50.0);
UILabel *newLabel = [[UILabel alloc] initWithFrame:frame];
newLabel.text = [NSString stringWithFormat:@"This is text for label: %d", index];
newLabel.backgroundColor = [UIColor whiteColor];
[self.view addSubview:newLabel];
[self.items setObject:newLabel forKey:[NSNumber numberWithInteger:index]];
}
Thoughts?