MSVC Address Sanitizer – Any reason to use it in Release builds?

  address-sanitizer, c++, msvc12, windows

Microsoft recently brought Address Sanitizer (ASan) to Microsoft Visual Studio 2019, and I’ve been experimenting with it. This question is specific to C and C++. My question is this: Is there any reason to have ASan enabled for Release builds, as opposed to having it enabled only for Debug builds? Having ASan turned on is devastating to the performance and memory usage of my program. (CPU performance worse than halved, memory usage tripled.) Therefore my hope is that if I enable ASan just to check for potential issues, and it does not detect any problems in a Debug build, then I can safely assume that there would not be any problems in the Release build that would have otherwise been caught by ASan? Certainly we are not meant to leave ASan enabled in Release/Production builds?

Thanks for any insight.

Source: Windows Questions

LEAVE A COMMENT