Subject: Re: Memory leak on mac

Re: Memory leak on mac

From: Will Cosgrove <will_at_panic.com>
Date: Tue, 16 Feb 2016 09:52:34 -0800

You’ll need to post an example app showing this leak; I use libssh2 on the Mac and have done extensive profiling and it does not leak in my use cases.

Will

> On Feb 16, 2016, at 9:43 AM, Velichko Yuriy <velichko.yuriy_at_gmail.com> wrote:
>
> Hello!
>
> I have application, that among other things, checks accessibility of the remote machine by connecting over ssh. The app immediately disconnect when connection is confirmed. All works fine on Mac and Windows. But on mac the app takes more and more memory (on windows is all right). The instruments for XCode shows that memory is leak in function
>
> libssh2_default_alloc
>
> but I do not call this function directly anywhere.
>
> To release ssh handlers methods are used:
>
> libssh2_channel_free( );
> libssh2_session_disconnect( );
> libssh2_session_free( );
>
> All of them works without errors.
>
> IMPOTANT NOTE: the leak occur when session works in non-blocking mode:
>
> libssh2_session_set_blocking( ..., 0);
>
> if to use
>
> libssh2_session_set_blocking( ..., 1);
>
> There is no leak.
>
> Tell me please what a difference. What I doing wrong? Or may be this is a little bug in libssh2?
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2016-02-16