Frequently asked questions included in version 3.6.1 of the Valgrind source clarify a bit:
"possibly lost" means that your program is skipping memory if you do not do unusual things with pointers, which may cause them to point to the middle of the selected block ; See the user manual for some possible reasons. Use --show-possibly-lost = no if you do not want to see these reports.
(5.2 Miscellaneous, Valgrind FAQ)
The Valgrind user guide talks about how it tracks all heap blocks allocated with malloc / new and describes two ways to track memory:
- By storing the "start pointer" at the beginning of the memory block
- Keeping the "interior pointer" at some place in the middle of the block
Three situations in which internal pointers may occur are:
- The pointer may have originally been a start pointer and was moved intentionally (or not intentionally) by the program.
- This may be a random, unwanted value in memory, completely unrelated, just a coincidence.
- It can be a pointer to an array of C ++ objects (which have destructors) assigned by the new [].
Possible scenarios:
Pointer chain AAA Category BBB Category
(4.2.7. Memory Leak Detection, Valgrind User Guide)
It turned out that the warning “Probably lost” covers cases 5-8 (for BBB) of the block above.
This means that a chain of one or more pointers to a block is found, but at least one of the pointers is a pointer to the inside. It may just be a random value in memory that occurs to point to a block, and therefore you should not consider it normal unless you know that you have pointers to the internals.
(4.2.7. Memory Leak Detection, Valgrind User Guide)
SO, in a rather long way, we come to the same conclusion as fbafelipe; assuming you are using the API correctly, either sqlite skips a little memory, or is involved in one of the valid cases above. Given the maturity of sqlite projects, it is probably safe to assume that the warning does not cause much concern.
If you provide more information about how you use the api (and under what circumstances a leak occurs), other people can provide a deeper understanding.
Link: Valgrind 3.6.1 source, doc / faq.html, doc / mc-manual.html