views:

34

answers:

2

My APP received a big data that was used about twice times. So, I think It`ll cause a memory problem.

In this case I use the WeakReference class on java. But, I couldn`t find any class for weak references like java.

Is there any class for weak refereces on iPhoneOS?

Is this the only way in this case, that using didReceiveMemoryWarning method and release code.

Thx.

A: 

iPhoneOS SDK does not support garbage collection so classes that implement weak referencing are not really needed. What I would suggest is that you run your app through Instruments (Choose Run->Run WIth Performance Tools->Allocations from Xcode 3.2.3. This will help you understand the memory usage of your app and detect possible leaks.

Diederik Hoogenboom
Weak references are not synonymous with garbage collection
Terry Mahaffey
I thought some one need this case for caching or memory management.U say it is not necessary.
TopChul
@Terry I know. They can also be useful to prevent retain cycles etc. His WeakReference java class is mainly used in relation to GC.
Diederik Hoogenboom
Yes, I should be managing retain cycles in didReceiveMemoryWarning.this is the similar roll of GC. so they won't implement this.Please, write infomation for this thread when U found some implementation of this.Thanks U.
TopChul
A: 

I think you should use persistent storage, if you want to play with big data because memory will not allow you beyond its limit.

Sanniv
Yes, I consider writing all management code.Thanks.
TopChul