|
ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
|
Cross-platform memory profiling utility. More...
#include <MemoryProfiler.h>
Public Types | |
| using | LogCallback = std::function<void(const QString &message)> |
Static Public Member Functions | |
| static void | checkpoint (const QString &label) |
| Log current memory usage with a label. | |
| static long | getPeakMemoryMB () |
| Get current peak memory usage in MB (maximum RSS since process start). | |
| static long | getCurrentMemoryMB () |
| Get current actual memory usage in MB (current RSS). | |
| static void | setLogCallback (LogCallback callback) |
| Set a callback for memory log messages (GUI hook). | |
Cross-platform memory profiling utility.
Provides lightweight memory usage tracking without external tools. Uses getrusage() on Unix/macOS and GetProcessMemoryInfo() on Windows. Enable via config: debug/enableMemoryProfiling=true
Definition at line 38 of file MemoryProfiler.h.
| using acav::MemoryProfiler::LogCallback = std::function<void(const QString &message)> |
Definition at line 40 of file MemoryProfiler.h.
|
static |
Log current memory usage with a label.
| label | Descriptive label for this checkpoint |
Definition at line 128 of file MemoryProfiler.cpp.
References getCurrentMemoryMB(), and getPeakMemoryMB().
Referenced by acav::MainWindow::loadCompilationDatabase(), and acav::AstExtractorRunner::run().
|
static |
Get current actual memory usage in MB (current RSS).
Definition at line 91 of file MemoryProfiler.cpp.
Referenced by checkpoint().
|
static |
Get current peak memory usage in MB (maximum RSS since process start).
Definition at line 65 of file MemoryProfiler.cpp.
Referenced by checkpoint().
|
static |
Set a callback for memory log messages (GUI hook).
Definition at line 56 of file MemoryProfiler.cpp.