Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-20-2010, 03:27 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 22
Default NSURLConnection Leak Central

Hi All

Does anyone else experience leaks of doom with the NSURLConnection class? I have read a lot about this over the net, but the articles I see are over 2 years old. Has this been rectified and it is just bad coding on my part?!!

I have read that changing from Sync to Async is better - but still getting issues, I have read to include:

[[NSURLCache sharedURLCache] setMemoryCapacity:0];
[[NSURLCache sharedURLCache] setDiskCapacity:0];

No effect.

I mainly get leaks after transferring lots of data, well I say that, only about 1.5meg.

If someone has a decent example of non leaky code, please post.

Or just anyones thoughts - preferably relevant!

Ta
richyclements is offline   Reply With Quote
Old 03-21-2010, 11:22 AM   #2 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,578
Default

I found in my app that the leak was more of a one-time thing than a leak of doom. My app submits files of data to the Google docs API, and I found that no matter how many files I submit, each with a new NSURLConnection created, I only saw memory leaked once. Since it did not build up, I figured it would never be an issue that would crash my app.

What is happening in your app?
JasonR is online now   Reply With Quote
Old 03-22-2010, 07:00 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 22
Default

Quote:
Originally Posted by JasonR View Post
I found in my app that the leak was more of a one-time thing than a leak of doom. My app submits files of data to the Google docs API, and I found that no matter how many files I submit, each with a new NSURLConnection created, I only saw memory leaked once. Since it did not build up, I figured it would never be an issue that would crash my app.

What is happening in your app?
Hi

Mine is more of a download app rather than upload. I have a loop that runs an async request, after each request I release and create a new object to get the next packet. After a couple of requests I see a huge spike on the leaks and looking I see its the CFNetwork class. It only appears to be on the device. The simulator doesnt appear to leak.

Any thoughts?
richyclements is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 328
22 members and 306 guests
@sandris, ADY, BrianSlick, dacapo, Dani77, djohnson, dre, HDshot, HemiMG, JasonR, MarkC, mer10, nibeck, prchn4christ, ryandb2, spiderguy84, themathminister, timle8n1, tomtom100, vogueestylee, vvenkatachallam
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,883
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, vvenkatachallam
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:07 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0