NSConnection memory leak when SSH Tunnelled connection
NSConnection memory leak when SSH Tunnelled connection
- Subject: NSConnection memory leak when SSH Tunnelled connection
- From: "Mike Silva" <email@hidden>
- Date: Sat, 13 Nov 2010 16:28:24 -0500
- Importance: normal
- Priority: normal
I am using a socket-based NSConnection between machine. Instead of a direct connection I use an SSH-tunnelled TCP connection for the NSConnection transport.
Basically I have a local NSConnection socket client that I connect to server localhost:59595 (for example). At localhost:59595 is a SSH tunnelled connection to the remote machine. On the remote machine there is an NSConnection server at port 60000.
This works, except that every request sent across the NSConnection leaks some memory here:
0 CoreFoundation _CFRuntimeCreateInstance
1 CoreFoundation __CFArrayInit
2 CoreFoundation -[__NSPlaceholderArray initWithCapacity:]
3 CoreFoundation -[__NSPlaceholderArray init]
4 Foundation -[NSConnection initWithReceivePort:sendPort:]
5 Foundation +[NSConnection connectionWithReceivePort:sendPort:]
6 Foundation -[NSConcretePortCoder connection]
7 Foundation +[NSDistantObject newDistantObjectWithCoder:]
8 Foundation -[NSConcretePortCoder decodeRetainedObject]
9 Foundation _NSWalkData2
10 Foundation -[NSConcretePortCoder decodeReturnValue:]
11 Foundation -[NSConnection sendInvocation:internal:]
12 Foundation -[NSDistantObject forwardInvocation:]
13 CoreFoundation ___forwarding___
14 CoreFoundation _CF_forwarding_prep_0
If I setup the SSH tunnel to use localhost:60000 (i.e. so the local server and the remote server use the same port number) then the connection leaks no memory. It seems that NSConnection has some knowledge or dependency on the actual server port vs. the port I'm having it connect to and this is causing a problem.
Has anyone ever done anything like this? any ideas on how to eliminate this memory leak per request?
Thanks.
Mike
Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683.2500 and delete this message and its attachments, if any.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden