Hello
I am attempting to download web sites with ASIHTTPRequest. It is a
great library.
However, I am currently encountering serious memory leaks as described
below. I used Analyze in XCode but found no warnings. I also searched
answers by using google and viewed past discussion in this
communication group, but both resulted in no related answers.
Therefore I start this thread in the hope that somebody may help me. I
will appreciate any of your hints or advices very much. Thank you in
advance.
------------------------------------------------------
Descriptions of the memory leaks:
------------------------------------------------------
The memory leaks happened when I use NSOperationQueue with
ASIHTTPRequest to download a website and its linked html files. Codes
followed the instructions at
http://allseeing-i.com/ASIHTTPRequest.
1. Experiment 1 for site A which has 368 files in total.
1.1 (Start the app) At the first time, it cost 22 MB to download all
files. Memory decreased from 119MB to 97MB.
1.2 (Clear the cache and continue the app) At the second time which
started after clearing the cache, it cost 16 MB to download same
files. Memory decreased from 97MB to 81MB.
1.3 (Clear the cache and continue the app) At the third time, it
crashed soon after the third time began. Memory decreased from 81MB to
10MB when finishing downloading first 100 files.
2. Experiment 2 for site B which has 292 files in total.
2.1 (Start the app) At the first time, it cost 25 MB to download all
files. Memory decreased from 121MB to 95MB.
2.2 (Clear the cache and continue the app) After the second time that
started after clearing the cache, it cost 88 MB to download same
files. Memory decreased from 96MB to 8MB.
2.3 (Start the app) It also cost 25BM, the same as 2.1
2.4 (Clear the cache and continue the app) It cost 96MB
3. Experiment 3 for site C which has 280 files in total.
3.1 (Start the app) Cost 8 MB (128MB -> 120MB)
3.2 (Clear the cache and continue the app) Cost 7MB (119MB -> 112MB)
3.3 (Clear the cache and continue the app) Cost 6MB (112MB -> 106MB)
3.4 (Clear the cache and continue the app) Cost 5MB (107MB -> 102MB)
3.5 (Clear the cache and continue the app) Cost 6MB (13MB -> 97MB)
------------------------------------------------------
Conclusions:
------------------------------------------------------
1. All experiments experienced memory leaks.
2. Total leaked MBs varied according to unknown reasons.
3. For some unknown reasons, memory may suddenly decrease by huge
amount, like 1.3, 2.2, 2.4
4. Only experiment 3 for site C showed steady memory leaks.
------------------------------------------------------
Need you help! Thank you!
------------------------------------------------------