All Projects → AviAvni → Nativeleakdetector

AviAvni / Nativeleakdetector

Win32 memory leak detector with ETW

Projects that are alternatives of or similar to Nativeleakdetector

Nuxt Memwatch
Quickly watch real-time memory stats of your nuxt app
Stars: ✭ 76 (+153.33%)
Mutual labels:  memory, leak
AppListManager
📱 AppListManager (Android Library) makes managing application and activity lists easy.
Stars: ✭ 59 (+96.67%)
Mutual labels:  memory, leak
Rxlifecycle
Rx binding of stock Android Activities & Fragment Lifecycle, avoiding memory leak
Stars: ✭ 131 (+336.67%)
Mutual labels:  memory, leak
Java-Memory-Manipulation
User friendly, Garbage-free, and cross-platform process, module and memory interfacing via the power of Java
Stars: ✭ 51 (+70%)
Mutual labels:  native, memory
Mysql Magic
dump mysql client password from memory
Stars: ✭ 183 (+510%)
Mutual labels:  memory, leak
AMLeaksFinder
A small tool for automatically detecting the [controller, view memory leak] in the project. 一款用于自动检测项目中【控制器内存泄漏,View 内存泄漏】的小工具,支持 ObjC,Swift。
Stars: ✭ 89 (+196.67%)
Mutual labels:  memory, leak
Deep Embedded Memory Networks
https://arxiv.org/abs/1707.00836
Stars: ✭ 19 (-36.67%)
Mutual labels:  memory
Memfs
In-memory filesystem with Node's API
Stars: ✭ 854 (+2746.67%)
Mutual labels:  memory
Free
Memory usage for macos, an alternative to free command.
Stars: ✭ 18 (-40%)
Mutual labels:  memory
Savannakit
A high-performance, protocol oriented, framework for creating native IDEs for iOS and macOS, written in Swift
Stars: ✭ 816 (+2620%)
Mutual labels:  native
Imgui
Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
Stars: ✭ 33,574 (+111813.33%)
Mutual labels:  native
Memory
STL compatible C++ memory allocator library using a new RawAllocator concept that is similar to an Allocator but easier to use and write.
Stars: ✭ 875 (+2816.67%)
Mutual labels:  memory
Ti.urlsession
Use the NSURLSession API to download and upload files in Titanium.
Stars: ✭ 7 (-76.67%)
Mutual labels:  native
Walle
iOS Application performance monitoring
Stars: ✭ 19 (-36.67%)
Mutual labels:  memory
Stats Js
JavaScript Performance Monitor using canvas
Stars: ✭ 12 (-60%)
Mutual labels:  memory
Encore
Synonym of angkor
Stars: ✭ 19 (-36.67%)
Mutual labels:  memory
Fake Jni
An implementation of the JNI and JVMTI with support for direct interaction between natively registered classes and JVM objects.
Stars: ✭ 20 (-33.33%)
Mutual labels:  native
Mpimemu
MPI Memory Consumption Utilities
Stars: ✭ 17 (-43.33%)
Mutual labels:  memory
React Native Geolocation Service
React native geolocation service for iOS and android
Stars: ✭ 934 (+3013.33%)
Mutual labels:  native
Originr
Species origin data from the web in R
Stars: ✭ 13 (-56.67%)
Mutual labels:  native

Win32 Leak Detector

This is a Win32 memory leak detector that instruments the Windows heap allocation APIs and collects real-time allocation information. It aggregates allocation stacks in real-time, and can display any memory allocated by an application that was not yet freed, helping identify and resolve memory leaks. It works only in live mode, and collects the HeapAlloc and HeapFree ETW events for a specified process. Unlike some other tools, this tool does not record every allocation and free event to a file on disk and analyzes them later -- for production processes with a heavy allocation load, this makes the difference between a working tool and a gigantic disk hog.

Importantly, if the target process exits before the tool had a chance to print stacks, symbol resolution will fail, so it is more suitable for longer-running processes.

NOTE: This project is not done. There are still some unimplemented features, and the code hasn't been extensively tested. Caveat emptor, and pull requests welcome!

Running

Open a command prompt window as administrator, and try the example Demo program.

Collect allocation events and print the top leaked stacks when Ctrl+C is hit:

LeakDetector -p 7408

Print the top stacks, sorted by top leak

  LeakDetector -T -p 7408

How often to print the stack summary in seconds

  LeakDetector -i 5 -p 7408

How many times to print a summary before quitting

  LeakDetector -c 5 -p 7408

Clear the screen between printouts

  LeakDetector -C -i 5 -p 7408

Example Output

18:26:32
AllocateCount: 30
FreeCount: 0
AlocateSize: 5040
FreeSize: 0
ntdll.dll!NtTraceEvent+0xC
ntdll.dll!RtlpLogHeapAllocateEvent+0x5F
ntdll.dll!RtlpAllocateHeapInternal+0x411
ntdll.dll!RtlAllocateHeap+0x3E
ucrtbased.dll!heap_alloc_dbg_internal+0x198
ucrtbased.dll!heap_alloc_dbg+0x36
ucrtbased.dll!_malloc_dbg+0x1A
ucrtbased.dll!malloc+0x14
Demo.exe!+0x11F0D
Demo.exe!+0x11AB2
Demo.exe!+0x119D0
KERNEL32.DLL!BaseThreadInitThunk+0x24
ntdll.dll!__RtlUserThreadStart+0x2F
ntdll.dll!_RtlUserThreadStart+0x1B
------------
AllocateCount: 20
FreeCount: 0
AlocateSize: 4000
FreeSize: 0
ntdll.dll!NtTraceEvent+0xC
ntdll.dll!RtlpLogHeapAllocateEvent+0x5F
ntdll.dll!RtlpAllocateHeapInternal+0x411
ntdll.dll!RtlAllocateHeap+0x3E
ntdll.dll!RtlpReAllocateHeap+0x1C2
ntdll.dll!RtlpReAllocateHeapInternal+0x660
ntdll.dll!RtlReAllocateHeap+0x43
Demo.exe!+0x11C1D
Demo.exe!+0x119D0
KERNEL32.DLL!BaseThreadInitThunk+0x24
ntdll.dll!__RtlUserThreadStart+0x2F
ntdll.dll!_RtlUserThreadStart+0x1B
------------
AllocateCount: 30
FreeCount: 24
AlocateSize: 3000
FreeSize: 2400
ntdll.dll!NtTraceEvent+0xC
ntdll.dll!RtlpLogHeapAllocateEvent+0x5F
ntdll.dll!RtlpAllocateHeapInternal+0x411
ntdll.dll!RtlAllocateHeap+0x3E
Demo.exe!+0x11BF0
Demo.exe!+0x119D0
KERNEL32.DLL!BaseThreadInitThunk+0x24
ntdll.dll!__RtlUserThreadStart+0x2F
ntdll.dll!_RtlUserThreadStart+0x1B
------------
AllocateCount: 4
FreeCount: 0
AlocateSize: 800
FreeSize: 0
ntdll.dll!NtTraceEvent+0xC
ntdll.dll!RtlpLogHeapAllocateEvent+0x5F
ntdll.dll!RtlpAllocateHeapInternal+0x411
ntdll.dll!RtlAllocateHeap+0x3E
ntdll.dll!RtlpReAllocateHeap+0xA7C
ntdll.dll!RtlpReAllocateHeapInternal+0x660
ntdll.dll!RtlReAllocateHeap+0x43
Demo.exe!+0x11C1D
Demo.exe!+0x119D0
KERNEL32.DLL!BaseThreadInitThunk+0x24
ntdll.dll!__RtlUserThreadStart+0x2F
ntdll.dll!_RtlUserThreadStart+0x1B

Requirements/Limitations

Kernel symbols are currently not resolved, and filtered out by default.

Overhead

This tool does not inject anything into the target process, and relies only on ETW events. Furthermore, it does not use disk buffers, and processes events in real-time. Still, very high allocation rates combined with an otherwise loaded system can introduce additional overhead due to the event processing and aggregation. Further benchmarking is needed to establish more accurate estimates.

Building

To build the tool, you will need Visual Studio 2015/2017, and the Windows SDK installed (for the symsrv.dll and dbghelp.dll files).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].