I am having a problem with an existing application. There is a cpp/module in the application that takes an instrument reading using a 3rd party IO board. It reads a voltage 1000 times a second and returns an average reading. To do this first a buffer of windows global memory is allocated. There is a handle of type HGLOBAL* that is returned by the function to allocate the buffer.
First a device sends a signal to request a reading. This starts the sample. Periodically inside a thread you check the status of the test. Of course I release the global memory when I close the application.
During the test if you open a new dialog, memory leaks. I know this because: #1 I see that after several hours of unattended operation controls like buttons start to go black or not show up at all. #2 I have tested the instrument reading function with CMemoryState objects and find leaks when I open additional dialogs. #3 After several hours of operation sometimes there is an invalid page-fault at the location of whatever windows control or device context may have been accessesed last.
I am wondering: Does Global windows Memory over-run the application CODE memory space? I am going to update to the next version of the library, but I am wondering if there is any way to move my application memory around so as not to have an overrun. It seems a mistake to allow application memory with data to conflict with the memory used by the application that is running the code. Not very bulletproof architecture.
First a device sends a signal to request a reading. This starts the sample. Periodically inside a thread you check the status of the test. Of course I release the global memory when I close the application.
During the test if you open a new dialog, memory leaks. I know this because: #1 I see that after several hours of unattended operation controls like buttons start to go black or not show up at all. #2 I have tested the instrument reading function with CMemoryState objects and find leaks when I open additional dialogs. #3 After several hours of operation sometimes there is an invalid page-fault at the location of whatever windows control or device context may have been accessesed last.
I am wondering: Does Global windows Memory over-run the application CODE memory space? I am going to update to the next version of the library, but I am wondering if there is any way to move my application memory around so as not to have an overrun. It seems a mistake to allow application memory with data to conflict with the memory used by the application that is running the code. Not very bulletproof architecture.