There is a concept of heaps in the Windows API, which is not very well known (judging by other answers so far). Honestly, I don't know much either, but here it is:
The windows API allows you to create different heaps, which means that the total number will depend on the application you are using, the behavior of the memory allocator on the heap can be slightly modified to accommodate different usage patterns (search low fragmentation heap). The most important difference is that memory obtained from one heap must be released into one heap. In most programs, you will not see or interact with different heaps directly, so you should not worry too much.
Just remember that when the library offers the Release method, you should use this and not delete , since the memory you got from the library may come from another heap.
source share