Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Mike Abdullah
On 13 Jan 2015, at 01:00, Graham Cox graham@bigpond.com wrote: I'm still having an issue with this - I think. I've exhaustively hunted down every leak and memory allocation in my app - luckily it's a fairly small one, though one that can create many threads - and have eliminated

Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Kevin Meaney
leaks, not bugs. Kevin On 13 Jan 2015, at 10:21, Kevin Meaney k...@yvs.eu.com wrote: On 13 Jan 2015, at 02:51, Graham Cox graham@bigpond.com wrote: On 13 Jan 2015, at 12:21 pm, Roland King r...@rols.org wrote: Did you read the devforums thread I pointed you at a couple of weeks ago?

Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Kevin Meaney
On 13 Jan 2015, at 02:51, Graham Cox graham@bigpond.com wrote: On 13 Jan 2015, at 12:21 pm, Roland King r...@rols.org wrote: Did you read the devforums thread I pointed you at a couple of weeks ago? Umm, not sure Roland. I read the blog post by bbum about using Allocations, which

Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Graham Cox
On 13 Jan 2015, at 8:11 pm, Mike Abdullah mabdul...@karelia.com wrote: One small suggestion: I think the frameworks would prefer it if you copied the ephemeralSessionConfiguration, and then modified the copy. Modifying this shared config is probably not supported, and while it might work

Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Mike Abdullah
On 13 Jan 2015, at 13:05, Graham Cox graham@bigpond.com wrote: On 13 Jan 2015, at 8:11 pm, Mike Abdullah mabdul...@karelia.com wrote: One small suggestion: I think the frameworks would prefer it if you copied the ephemeralSessionConfiguration, and then modified the copy. Modifying

Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Jens Alfke
May I just jump in to say that you probably should be discussing this on the macnetworkprog list? There are people on that list (esp. Quinn) who are experts in this area. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Debugging memory leak in NSURLSession with ARC

2015-01-12 Thread Graham Cox
I'm still having an issue with this - I think. I've exhaustively hunted down every leak and memory allocation in my app - luckily it's a fairly small one, though one that can create many threads - and have eliminated everything I have control over* My heap space is still growing over time. I'm

Re: Debugging memory leak in NSURLSession with ARC

2015-01-12 Thread Roland King
Did you read the devforums thread I pointed you at a couple of weeks ago? I noted it was iOS not OSX however my general belief is as time goes by, more and more code is common to the platforms so if there’s a bug in iOS at 8.x (and there is) it may also exist on OSX at some recent version. On

Re: Debugging memory leak in NSURLSession with ARC

2015-01-12 Thread Roland King
https://devforums.apple.com/message/1056669#1056669 No that one from the same mail. On 13 Jan 2015, at 10:51, Graham Cox graham@bigpond.com wrote: On 13 Jan 2015, at 12:21 pm, Roland King r...@rols.org wrote: Did you read the devforums thread I pointed you at a couple of weeks

Re: Debugging memory leak in NSURLSession with ARC

2015-01-12 Thread Graham Cox
On 13 Jan 2015, at 12:21 pm, Roland King r...@rols.org wrote: Did you read the devforums thread I pointed you at a couple of weeks ago? Umm, not sure Roland. I read the blog post by bbum about using Allocations, which is the one you linked in this thread. Did you mean something else?

Re: Debugging memory leak in NSURLSession with ARC

2015-01-12 Thread Graham Cox
Thanks - sorry I missed it in the first mail for some reason. An interesting thread. This remark from Quinn stood out for me: If you stop issuing new requests, NSURL{Session,Connection} quickly recovers this memory to the point where, at the end of a cycle like this, the memory use (as shown

Re: Debugging memory leak in NSURLSession with ARC

2015-01-12 Thread Roland King
On 13 Jan 2015, at 11:20, Graham Cox graham@bigpond.com wrote: Thanks - sorry I missed it in the first mail for some reason. An interesting thread. This remark from Quinn stood out for me: If you stop issuing new requests, NSURL{Session,Connection} quickly recovers this memory to

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread David Duncan
On Jan 1, 2015, at 3:38 PM, Graham Cox graham@bigpond.com wrote: Hi all, I know I'm very, very late to the party, but I'm building my first ever project with ARC instead of manual retain/release (which I was always very comfortable with). Frankly, I'm finding it frustrating because

Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Graham Cox
Hi all, I know I'm very, very late to the party, but I'm building my first ever project with ARC instead of manual retain/release (which I was always very comfortable with). Frankly, I'm finding it frustrating because it seems much harder to know how memory is managed. Anyway. I will plough on

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Quincey Morris
On Jan 1, 2015, at 17:20 , Graham Cox graham@bigpond.com wrote: I'm using Allocations, but I'm finding the volume of data a bit overwhelming. As an aside, Leaks shows nothing at all. Does that mean I'm not actually leaking anything? Forget Leaks, it’s an utter waste of time*. Use

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Graham Cox
On 2 Jan 2015, at 10:52 am, David Duncan david.dun...@apple.com wrote: The first thing to keep in mind is that unless otherwise qualified, all object references are owned - locals, ivars, array entries, etc. The places where this isn’t possible (such as structs) are flagged as compiler

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Cosmo
A while back I had a similar sounding issue in an iOS project I was working on. The memory usage kept growing, although I could find no obvious culprits in my code after hours of exploration. My solution probably doesn’t pertain to you, but I thought I’d pass it along just in case it’s

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Joar Wingfors
On 1 jan 2015, at 18:26, Graham Cox graham@bigpond.com wrote: On 2 Jan 2015, at 12:48 pm, Quincey Morris quinceymor...@rivergatesoftware.com wrote: That usually means the block and the ‘self’ it captured mutually refer to each other. I’m betting this is what’s wrong in your

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Joar Wingfors
On 1 jan 2015, at 18:22, Roland King r...@rols.org wrote: +1 for all of this. I wouldn't call leaks an utter waste of time, but it really does only find pure retain cycles (which it then annotates very nicely) and not memory which is really is pinned by a real reference which is more

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Roland King
On 2 Jan 2015, at 10:52, Joar Wingfors j...@joar.com wrote: On 1 jan 2015, at 18:22, Roland King r...@rols.org wrote: +1 for all of this. I wouldn't call leaks an utter waste of time, but it really does only find pure retain cycles (which it then annotates very nicely) and not memory

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Clark S. Cox III
On Jan 1, 2015, at 18:26, Graham Cox graham@bigpond.com wrote: On 2 Jan 2015, at 12:48 pm, Quincey Morris quinceymor...@rivergatesoftware.com wrote: That usually means the block and the ‘self’ it captured mutually refer to each other. I’m betting this is what’s wrong in your

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Roland King
My handler block refers to 'self' quite extensively - it calls other methods of self and also refers to properties such as self.delegate. I'm not quite sure how I can rework it not to refer to self. Maybe I just need to not use the completion block approach and use a delegate callback

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Graham Cox
On 2 Jan 2015, at 12:48 pm, Quincey Morris quinceymor...@rivergatesoftware.com wrote: That usually means the block and the ‘self’ it captured mutually refer to each other. I’m betting this is what’s wrong in your case. Quincey, thanks for your lengthy and well-thought-out reply

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Roland King
+1 for all of this. I wouldn't call leaks an utter waste of time, but it really does only find pure retain cycles (which it then annotates very nicely) and not memory which is really is pinned by a real reference which is more often the case. Also, if you're using KVO anywhere, this tends to

Re: Debugging memory leak in NSURLSession with ARC

2015-01-01 Thread Graham Cox
On 2 Jan 2015, at 1:46 pm, Roland King r...@rols.org wrote: Having a handler block which refers to self is not in and of itself a problem, very many blocks implicitly do. The block retains self, however in most cases something else retains the block and the self reference goes away when