# Report Memory Errors

You can report memory leaks and memory overwrites in the log file by enabling the memory trace system, either by using the API or environment variables. If the memory trace system is enabled, the extended error codes for memory leaks and memory overwrites (`26` and `27`, respectively) are reported in the log file when they are generated. The extended error codes are defined in `KVErrorCodeEx` in `kverrorcodes.h`.

NOTE: To report memory overwrites, you must also set a memory guard. See Specify a Memory Guard.

## Use the API

To enable or disable the memory trace system, set the final argument (`dwFlags`) of fpInit(), fpInitWithLicenseData() or fpOpenStreamEx2() to either `KVF_OOPMEMTRACEON` or `KVF_OOPMEMTRACEOFF`.

## Use Environment Variables

To enable the memory trace system, add the `KVOOPMT` environment variable, and set its value to `1`. To disable the memory trace system, do not set the `KVOOPMT` environment variable.

© Copyright 2016-2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm