PDA

View Full Version : Memory Problem




testgame
Aug 18, 2010, 08:38 AM
Hello,

I have memory problem in my application. I am integrating some application in one application.

Following is my problem:
-I have one UIView named MainView.
At this time memory usage is 9.0 mb.

-now i am adding another view on it.
Memory usage increase to 13-15 mb.

- When i release that newly added view from superview. [self removefromsuperview];
Memory is 9.5 mb. it's not 9.0 mb.

- As i open more views memory increases.

I release all the objects & controls i take in that view.

Pls help me to solve this problem.

Thanks in Advance.



robbieduncan
Aug 18, 2010, 09:13 AM
Without the code it is impossible to help: you are most likely allocating memory and not releasing it.

sherry2009
Aug 18, 2010, 10:21 PM
release that newly added view ,not just [self removefromsuperview],also [newly_added_view release];Are you release it?

testgame
Aug 19, 2010, 01:06 AM
release that newly added view ,not just [self removefromsuperview],also [newly_added_view release];Are you release it?

Thanks for your reply.

I have one mainView. It contains button 1 to 5.

When I click on button 1, I write following code.

view1 *view = [[view1 alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
[self.superview addSubview:view];
[view release];

& in view1 i write [self removeFromSuperView]; To go back to mainView.
I release all the objects i took in view1.

At this time memory problem occurs. As I click on more buttons & add more views memory increases even i m removing it.