Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Memory Analysis in lesson 12 of libcurl

Shulou Source: shulou.com Published: 2022-06-03 03:45:33 10月03日 Update

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

Tags: Memory detection analysis obvious continuous code function actual application interface mode module environment program structure reference growth application test assistant Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MariaDB Shulou Tech Info Xiaomi macOS