| Hi,
I fax'ed the following reply to the customer on 5th Febraury.
I haven't heard anything since so I've closed the call.
Christopher Gibson
SPE UK
[email protected]
--------cut here--------
Dear Gerd,
Re: ASAP Call
I have been given the details of the software development problem you
are experiencing with Windows NT on Alpha. If the problem is, as you
believe, related to memory management then you do have a number of
options.
"Is there a possibility to continuously monitor the memory management
(special tool/library)?"
The debug version of the C Run-Time Library does have support for a
debug heap. This is used by linking to the debug version of this
library. The debug heap free() routine checks to see if the application
has tried to use more memory than was allocated for the block. Other
checks can be performed from within your code. You can for example:
� Carry out a periodic check of the heaps integrity with a call to
_CrtCheckMemory() (this can also be done automatically at every
allocation and deallocation but will significantly affect
performance)
� Check for memory leaks when the program exits
� Simulate low memory situations
� Dump the current state of the heap
� Track heap allocation requests to help identify errant code
� Add your own hooks to the debug code
For more information see the online Visual C++ documentation under:
Visual C++ Books
C/C++
Run-Time Library Reference
Debug Version of the C Run-Time Library
Memory Management and the Debug Heap
There are also powerful third party tools available to help track down
memory management problems. One which is available for Intel and Alpha
is SmartHeap from MicroQuill Software Publishing, Inc. I have never
used this tool but its list of features looks comprehensive. Take a
look at their Web site to judge for yourself
(http://www.microquill.com/).
"Are their other debug options?"
There is a possibility that your program is running out of heap space,
particularly as it is so large. A tool called Pview can be used to help
check (see the online documentation for details).
Does your application check for NULL return values from malloc() or
new. The default is heap size 1 MB, but this can be changed with the
/HEAP link option.
"Have you other suggestions as to how to locate the error?"
You could include some structured exception handling in your
application. This allows you to trap errors and either handle them or
terminate gracefully. When your application traps an exception you can:
� Determine which exception which occurred
� Get the address where the exception occurred.
Once again see the online documentation for the try / except / finally,
GetExceptionCode(), and GetExceptionRecord().
You can find this under:
SDKs
Win32 SDK
Win32 Programmers Reference
Overviews
System Services
Structured Exception Handling
See also C++ Exception Handling (the try, catch, and throw statements)
in the C++ Language Reference if you are using this language.
Yours sincerely,
Christopher Gibson
Software Partners Engineering
Digital Equipment Co. Limited
|