Memory leak when using DB_DBT_MALLOC in CDB.
919497Feb 23 2012 — edited Feb 28 2012Hello!
Recently when I'm using Berkeley DB CDB and set the value Dbt DB_DBT_MALLOC, I noticed that the app's memory keeps growing during the db.get while;
I found that many codes on the internet use the syntax free(value.get_data()), but when I tried to free the value.get_data(), I always got an interruption error.
It's OK when I'm using the DB_DBT_USERMEM flag. So I just get very confused about the DB_DBT_MALLOC and DB_DBT_REALLOC.
And also, I wonder why there's no memory leak problem when we use the single thread BDB. I think BDB cannot free the value.data pointer too in single thread before the app finish using it, then why our apps don't need to free the data afterwards?
Thanks a lot in advance!