Re: TableView leaks a lot of memory
Re: TableView leaks a lot of memory
- Subject: Re: TableView leaks a lot of memory
- From: Anders Lassen <email@hidden>
- Date: Mon, 16 Feb 2009 08:44:27 +0100
Hi,
Ok, I will file this as a bug.
Kind regards,
Anders Lassen
On Feb 16, 2009, at 8:28 AM, Bill Bumgarner wrote:
Can you file a bug, please, and attach either your project or a
binary along w/steps to reproduce using said example?
http://bugreport.apple.com/
thanks,
b.bum
On Feb 15, 2009, at 11:16 PM, Anders Lassen wrote:
Hi,
I am working on a small Cocoa application, which uses a TableView
to display information that is collected from an internet site. A
timer reloads the TableView every second.
The problem is that everytime the timer reloads the TableView,
about 5 - 20 MB of memory is used (depending on how many rows there
are in the tableview).
After running a while, all free memory is used on the computer, and
it begins to swap.
I have figured out that this happens due to the following conditions:
- The garbage collector is on
- A timer is used for reload
- A column contains a Check Box Cell
Ergo, the problem vanish, if I:
- turn the garbage collector off
- or reload manually
- or remove the Check Box Cell
I am a bit surprised about this, since I guess that other may have
ran into to the same problem.
Note that the program is very simple. The main window only contains
a TableView with one column, which has 10 rows. Each cell contains
a Check Box Cell.
The code is:
@implementation Controller
-(void)awakeFromNib
{
timer = [[NSTimer scheduledTimerWithTimeInterval:1 target:self
selector:@selector(timer:)
userInfo:nil repeats:YES]
retain];
}
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return 10;
}
-(void)timer:(NSTimer*)timer
{
[tableView reloadData];
}
@end
Thanks
Anders Lassen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden