-
-
Notifications
You must be signed in to change notification settings - Fork 441
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I was facing a memory leak in long-running spiders. After investigating for about a month, it turned out that only the spiders using CurlOpt.RESOLVE were affected and leak was originating from curl-cffi.
After adding this one line into reset() leak disappeared . I’m not entirely sure if this is the correct or best approach, but it does stop the leak.
curl_cffi/curl.py
def reset(self) -> None:
self._is_cert_set = False
lib.curl_slist_free_all(self._resolve) # Add this line
if self._curl is not None:
lib.curl_easy_reset(self._curl)
self._set_error_buffer()
self._resolve = ffi.NULLMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working