cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Reducing memory consumption.

From: Robert Iakobashvili <coroberti_at_gmail.com>
Date: Sun, 14 Dec 2008 22:51:40 +0200

Hi Tsachi,

On Sun, Dec 14, 2008 at 6:34 PM, Tsachi <tsachi.kimel_at_gmail.com> wrote:
>
> Hey,
>
> (I am using "libcurl 7.19.1" with c-ares 1.5.3 (over linux)).
> I am writing a program which fetches many http links simultaneously.
> I have noticed that every time I call curl_easy_init() around 70K of
> memory is allocated.
> Now taking into consideration that I want to use around 1000 handles,
> this might be an issue (~70 MB in memory).
>
> Is there a way to reduce that ?
>
> Thanks,
> Tsachi

Yes,

Pass to the CFLAGS upon configuration a smaller size of buffer, something like
 -DCURL_MAX_WRITE_SIZE=4096

See e.g. as it does curl-loader here:
http://curl-loader.svn.sourceforge.net/viewvc/curl-loader/trunk/curl-loader/Makefile?view=markup

1000 users is not an issues.
Some users are already using curl-loader with 100K handles,
separated to 8 multi-handles, each in its own thread.

Take care!

--
Truly,
Robert Iakobashvili
......................................................................
www.ghotit.com
Assistive technology that understands you
......................................................................
Received on 2008-12-14