Memory Analysis in lesson 12 of libcurl
In the actual test environment, memory is growing, though not obvious
Code request memory analysis
Struct Curl_multi * Curl_multi_handle (int hashsize, / * socket hash * /
Int chashsize) / * connection hash * /
This function creates the Curl_muti structure and requests several blocks of memory, namely hostcache,sockhash,conn_cache
Void curl_easy_cleanup (struct Curl_easy * data)
Curl_close (data)
Memory detection
Using vld to detect
After calling curl_global_cleanup ();, no memory leaks were detected, and it is not known where the memory has been saved.
Curl_global_cleanup performs two operations
1) Uninstall iphlpapi.dll (Windows IP Auxiliary API API Module)
2) Uninstall Win32Sock: WSACleanup ()
Referenc
Https://www.jianshu.com/p/7b7cff13e731