[comp.windows.misc] MS-Windows question...

shan@ihlpl.ATT.COM (Califf) (11/03/88)

I have a small window program in which I am constantly allocating small
amounts of memory from my local heap. I allocate the memory by using the
LocalAlloc function, and then using the LocalLock function to retrieve
a pointer to that memory space. Once through using the memory, I release 
the memory by first unlocking it and then freeing it. When allocating the 
memory, I use the flags which allow the memory to be allocated as MOVEABLE. 
  The problem seems to occur when I release all of the memory and use the
LocalCompact function to compact memory. The first time the program begins to
allocate any memory, I call LocalCompact to see how much CONTIGUIOUS memory
is avaliable. The number returned from this function indicates about 49000
bytes of free memory space. After allocating and then FREEING
all of the memory, LocalCompact will not RECLAIM that memory for me, and
eventually if I keep allocating and freeing memory, I run out of LOCAL
HEAP and the program won't continue to run.
   Does anybody know what is happening, or has anyone ever experienced this
problem?...