C++/C++
[메모리] 메모리 프로파일링
Elan
2022. 4. 6. 01:50
STOMP Allocator같은 것을 통해 디버깅 시에 메모리 오염을 미리 감지하는 등의 방법에 대해서 배웠다.
하지만 이 방법들은 오래된 방법들이며,
그렇게 효과적인 방법이라고는 얘기 할 수 없을 것 같다.
이미 windows운영체제에서는 각종 Memory Analysis Tool을 제공한다.(메모리 프로파일링 API)
예를 들면 ETW같은 Memory Allocation Event를 추적하는 API가 있다.
성능도 당연히 우수하고 어느정도의 GUI를 지원한다.
Customized Allocator에서도 할당/해제를 추적할 수 있는 것은 기본이고,
할당 히스토리를 상세하게 볼 수도 있다.
메모리 누수도 확인이 가능하다.
https://docs.microsoft.com/en-us/visualstudio/profiling/custom-native-etw-heap-events?view=vs-2022
Custom Native ETW Heap Events - Visual Studio (Windows)
Learn how to use a custom heap to reduce allocation overhead, but still provide allocation information to the memory profiler for allocation analysis.
docs.microsoft.com