Open simon639 opened 2 years ago
Confirmed.
It seems MySQL driver has no finalization process while PostgreSQL driver has finalization on GC (powered by trivial-garbage)
(SQLite3 has a function free-query-resources
to free it manually)
Need to be fixed.
It seems return-or-close
does free the last result set internally.
https://github.com/hackinghat/cl-mysql/blob/3fbf6e1421484f64c5bcf2ff3c4b96c6f0414f09/pool.lisp#L256
As a result, your single line patch raises free(): double free detected in tcache 2
. Requires more investigation.
above code run in hunchentoot will lead to memory leak in MySQL
https://blog.actorsfit.in/a?ID=01800-28830ddf-a436-4fff-b97d-d952487c8948
the result set of mysql_store_result(), mysql_use_result(), and mysql_list_dbs() must call mysql_free_result() to release the memory used by the result set after completing the operation on the result set.