When ran in activity monitor, the real memory usage for a program running the following piece of code will increase endlessly:
CGRect frame = CGRectMake(0,0,0,0);
while(true)
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];
UIView *test = [[UIView alloc] initWithFrame:frame];
[test release];
[pool release];
}
What happens is that all objects derived from UIView will leak. Some will leak more than others (UITextView in particular has drawn atention to this problem). The leaks are not actualy discovered in the leaks monitor - their presence is only revealed by the constant increase in memory usage - which eventualy leads to the app being terminated by the OS because of memory exhaustion.
Has anyone noticed this before? For the record, the code was compiled for OS 3.0.