|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker mailing list Archives
[ curl-Bugs-1634515 ] Large Virtual Memory size
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sat, 13 Jan 2007 10:35:09 -0800
Bugs item #1634515, was opened at 2007-01-12 19:32
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
I am a first time user of the libcurl library.
I run into an issue that when launching libcurl from threads, if the number of threads is above 9 the virtual memory consumption increases disproportionatly.
In the code sample below:
#include <fstream>
using namespace std;
pthread_mutex_t COUNTER_MUTEX = PTHREAD_MUTEX_INITIALIZER;
void* executeStuff (void* arg )
CURL* easyhandle = curl_easy_init();
char execStr[128];
curl_easy_setopt(easyhandle, CURLOPT_URL, execStr);
cout << "Executing : " << execStr << " Reslut ( 0 = OK): " << success << endl;
curl_easy_cleanup(easyhandle);
pthread_mutex_lock(&COUNTER_MUTEX);
int main ()
pthread_t thread_id;
for ( int i=0; i<9; ++i)
pthread_mutex_lock(&COUNTER_MUTEX);
while ( THREAD_COUNTER > 0 )
cout << "Done!" << endl;
return 0;
the amount of virtual memory consumed will be 90 MB, on the other hand if there are only 8 threads launched, only 80K of virtual memory be consumed.
Please advise,
Is this a normal behaviour or do I have problem with my code.
Thank you very much.
----------------------------------------------------------------------
>Comment By: Dan Fandrich (dfandrich)
Message:
You need to call curl_global_init in main() before starting any threads.
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info