15

I am tried to make iOS Application using AFNetworking in UITableView. TableView loads 20 datas like Twitter's timeline.

When it loads over 80 datas, Xcode shows spending about 70MB memory and console shows

"Received memory warning."

And

**"error in __connection_block_invoke_2: Connection interrupted".**

What is this and How do I treat this error?

Rajesh Loganathan
  • 11,129
  • 4
  • 78
  • 90
masuhara
  • 179
  • 1
  • 2
  • 9

1 Answers1

8

Reason: When you load more data which contains above 70 mb will get crash.

Sol: Load data (EG:)40 only at a time. Then load another (EG:)40 next time by fetching data from web service. Fetch (EG)40 data by hitting service each time & reload tableview using pull to refresh concept.

  • 260 MB of ram (iPad 2)
  • 170-180MB of ram on devices with 512 Mb of ram total (iPhone 4, iPod touch 4g)
  • 40-80MB of ram on devices that have 256 MB of ram (iPad, iPhone 3gs, iPod touch 3g)
  • 25 MB on device with only 128MB of ram (IPhone 3g, iPhone 2g, iPod touch 1g-2g)

Refer following links to know about memory leakage:

  1. Max Memory
  2. Memory limit
Community
  • 1
  • 1
Rajesh Loganathan
  • 11,129
  • 4
  • 78
  • 90
  • Thank you very much. I try to read it. Could you tell me why only 40 data can be fetched? If you have some references which mention "40" data, please tell me.(´・ω・`) – masuhara Dec 12 '14 at 06:17
  • When you hit bulk data at a time it occurs memory issues & gets crash – Rajesh Loganathan Dec 12 '14 at 08:41
  • Are there other reasons this might happen? Having this same issue, but memory doesn't appear to be the issue: http://stackoverflow.com/questions/36486001/ios-error-in-connection-block-invoke-2-connection-interrupted-but-app-only – Crashalot Apr 07 '16 at 20:04
  • 4
    This answer only tells us why the "Recieved memory warning." error happens. Does anyone have an answer as to why the "error in __connection_block_invoke_2: Connection interrupted" happens, my question got flagged as a duplicate. – James Wolfe Apr 11 '16 at 14:53
  • @JamesWolfe same problem as you, did you find an answer? – Crashalot Apr 26 '16 at 16:50
  • 3
    I'm afraid not, I tried posting a unique question about this but it got marked as a duplicate for this question, I don't think the user who reported it read past the title. – James Wolfe Apr 27 '16 at 21:23