Re: CURL and Connection limits
Re: CURL and Connection limits
- Subject: Re: CURL and Connection limits
- From: "stephen joseph butler" <email@hidden>
- Date: Wed, 19 Sep 2007 00:13:25 -0500
On 9/17/07, Jofell Gallardo <email@hidden> wrote:
> Surely, I checked if I closed my file handles and curl connections, which
> led me to get away from any
> NSURLRequest instantiation and use libcurl for me to force the closing of a
> connection. Unfortunately, the
> problem still persists.
One other thing you could try is increasing the limit for your
process. For example, before doing your CURL work execute something
like this:
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
int main( int argc, char **argv )
{
struct rlimit rl = {0};
int result = 0;
result = getrlimit( RLIMIT_NOFILE, &rl );
if (result != 0)
printf( "getrlimit = %d\n", errno );
else {
printf( "rl.rlim_cur = %d\n", rl.rlim_cur );
printf( "rl.rlim_max = %d\n", rl.rlim_max );
rl.rlim_cur = 512;
result = setrlimit( RLIMIT_NOFILE, &rl );
if (result != 0)
printf( "setrlimit = %d\n", errno );
else
printf( "setrlimit succeeded\n" );
}
return 0;
}
If the number of files you can handle suddenly increases to ~ 500 then
you know you're still leaking handles somewhere.
_______________________________________________
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