# rapabru/ram-mannager architecture

> Architecture diagram of the GitHub repository rapabru/ram-mannager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rapabru/ram-mannager
- Repository: https://github.com/rapabru/ram-mannager

## Overview

RAM Manager is a local Windows desktop tool for observing physical memory, investigating processes and memory growth, and performing explicit NT memory-manager cleanup operations. Its central workflow is MainViewModel refresh and navigation: it gathers system and process measurements, records leak-tracking samples, presents analysis and recommendations, and dispatches user-selected operations whose results are audited and surfaced as notifications. The README documents additional graph, floating-monitor, tray, diagnostics, history, and appearance capabilities. Some feature wiring is inferred from documented behavior because those implementations were not sampled.

Main entry points: [`RAMManager/ViewModels/MainViewModel.cs`](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/MainViewModel.cs) (Main coordinator), [`RAMManager/Services/MemoryOperationService.cs`](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/MemoryOperationService.cs) (Operation dispatcher), [`RAMManager/Services/MemoryService.cs`](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/MemoryService.cs) (Memory statistics), [`RAMManager/Views/MainWindow.xaml.cs`](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Views/MainWindow.xaml.cs) (Main window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_mainwindow["Main window<br/>[MainWindow.xaml.cs]"]
  node_mainvm["Main coordinator<br/>[MainViewModel.cs]"]
  node_dashboard["Overview"]
  node_cleanupui["Cleanup screen"]
  node_processui["Process screen"]
  node_diagnosticsui["Diagnostics screen"]
  node_historyui["History screen"]
  node_graphui["Memory graph"]
  node_leakui["Leak investigator"]
  node_widget["Floating monitor"]
end

subgraph group_monitoring["Monitoring and analysis"]
  node_memory["Memory statistics<br/>[MemoryService.cs]"]
  node_processes["Process analysis<br/>[ProcessService.cs]"]
  node_recommendations["Recommendations"]
  node_leakservice["Growth sampling"]
  node_hardware["Hardware details"]
  node_trendchart["Trend chart"]
end

subgraph group_operations["Memory operations"]
  node_operation["Operation dispatcher"]
  node_native["Windows memory APIs<br/>[NativeMethods.cs]"]
  node_privilege["Privilege handling"]
end

subgraph group_support["State and integrations"]
  node_history["Audit history<br/>[HistoryService.cs]"]
  node_settings["User preferences<br/>[SettingsService.cs]"]
  node_theme["Theme service<br/>[ThemeService.cs]"]
  node_tray["System tray<br/>[TrayIconManager.cs]"]
end

node_user(("User"))
node_wmi["Windows WMI"]
node_windows["Windows system"]

node_user -->|"uses"| node_mainwindow
node_mainwindow -->|"presents"| node_mainvm
node_mainvm -->|"refreshes"| node_memory
node_mainvm -->|"queries"| node_processes
node_mainvm -->|"records samples"| node_leakservice
node_mainvm -->|"requests guidance"| node_recommendations
node_mainvm -->|"dispatches operations"| node_operation
node_mainvm -->|"reads preferences"| node_settings
node_mainvm -->|"applies theme"| node_theme
node_mainvm -->|"updates"| node_dashboard
node_mainvm -->|"updates"| node_cleanupui
node_mainvm -->|"updates"| node_processui
node_mainvm -->|"updates"| node_diagnosticsui
node_mainvm -->|"updates"| node_historyui
node_mainvm -->|"updates"| node_graphui
node_mainvm -->|"updates"| node_leakui
node_mainvm -->|"exposes live data"| node_widget
node_mainvm -->|"provides quick actions"| node_tray
node_cleanupui -->|"requests cleanup"| node_operation
node_memory -->|"queries memory counters"| node_windows
node_processes -->|"enumerates processes"| node_windows
node_recommendations -->|"evaluates snapshot"| node_memory
node_leakservice -->|"stores measurements"| node_memory
node_graphui -->|"loads hardware details"| node_hardware
node_graphui -->|"displays samples"| node_trendchart
node_hardware -.->|"queries module data"| node_wmi
node_operation -->|"captures snapshots"| node_memory
node_operation -->|"records result"| node_history
node_operation -->|"issues NT commands"| node_native
node_operation -->|"checks elevation"| node_privilege
node_native -->|"invokes system APIs"| node_windows
node_privilege -->|"adjusts privileges"| node_windows
node_historyui -->|"reads audit log"| node_history
node_settings -->|"supplies saved choice"| node_theme
node_theme -->|"updates appearance"| node_mainwindow
node_tray -->|"signals tray actions"| node_mainwindow

click node_mainwindow "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Views/MainWindow.xaml.cs"
click node_mainvm "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/MainViewModel.cs"
click node_dashboard "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/OverviewViewModel.cs"
click node_cleanupui "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/CleanupViewModel.cs"
click node_processui "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/ProcessesViewModel.cs"
click node_diagnosticsui "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/DiagnosticsViewModel.cs"
click node_historyui "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/HistoryViewModel.cs"
click node_graphui "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/MemoryGraphViewModel.cs"
click node_leakui "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/LeakTrackerViewModel.cs"
click node_widget "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Views/FloatingWidgetWindow.xaml.cs"
click node_memory "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/MemoryService.cs"
click node_processes "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/ProcessService.cs"
click node_recommendations "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/RecommendationEngine.cs"
click node_leakservice "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/LeakTrackerService.cs"
click node_hardware "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/HardwareInfoService.cs"
click node_trendchart "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Controls/MemoryTrendChart.xaml.cs"
click node_operation "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/MemoryOperationService.cs"
click node_native "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Native/NativeMethods.cs"
click node_privilege "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Native/PrivilegeManager.cs"
click node_history "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/HistoryService.cs"
click node_settings "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/SettingsService.cs"
click node_theme "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/ThemeService.cs"
click node_tray "https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Native/TrayIconManager.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mainwindow,node_mainvm,node_dashboard,node_cleanupui,node_processui,node_diagnosticsui,node_historyui,node_graphui,node_leakui,node_widget,node_user toneBlue
class node_memory,node_processes,node_recommendations,node_leakservice,node_hardware,node_trendchart toneAmber
class node_operation,node_native,node_privilege toneMint
class node_history,node_settings,node_theme,node_tray toneRose
class node_wmi,node_windows toneIndigo
```

## Components

### Desktop interface

- [Main window](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Views/MainWindow.xaml.cs): `RAMManager/Views/MainWindow.xaml.cs`
- [Main coordinator](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/MainViewModel.cs): `RAMManager/ViewModels/MainViewModel.cs`
- [Overview](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/OverviewViewModel.cs): `RAMManager/ViewModels/OverviewViewModel.cs`
- [Cleanup screen](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/CleanupViewModel.cs): `RAMManager/ViewModels/CleanupViewModel.cs`
- [Process screen](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/ProcessesViewModel.cs): `RAMManager/ViewModels/ProcessesViewModel.cs`
- [Diagnostics screen](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/DiagnosticsViewModel.cs): `RAMManager/ViewModels/DiagnosticsViewModel.cs`
- [History screen](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/HistoryViewModel.cs): `RAMManager/ViewModels/HistoryViewModel.cs`
- [Memory graph](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/MemoryGraphViewModel.cs): `RAMManager/ViewModels/MemoryGraphViewModel.cs`
- [Leak investigator](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/ViewModels/LeakTrackerViewModel.cs): `RAMManager/ViewModels/LeakTrackerViewModel.cs`
- [Floating monitor](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Views/FloatingWidgetWindow.xaml.cs): `RAMManager/Views/FloatingWidgetWindow.xaml.cs`

### Monitoring and analysis

- [Memory statistics](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/MemoryService.cs): `RAMManager/Services/MemoryService.cs`
- [Process analysis](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/ProcessService.cs): `RAMManager/Services/ProcessService.cs`
- [Recommendations](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/RecommendationEngine.cs): `RAMManager/Services/RecommendationEngine.cs`
- [Growth sampling](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/LeakTrackerService.cs): `RAMManager/Services/LeakTrackerService.cs`
- [Hardware details](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/HardwareInfoService.cs): `RAMManager/Services/HardwareInfoService.cs`
- [Trend chart](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Controls/MemoryTrendChart.xaml.cs): `RAMManager/Controls/MemoryTrendChart.xaml.cs`

### Memory operations

- [Operation dispatcher](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/MemoryOperationService.cs): `RAMManager/Services/MemoryOperationService.cs`
- [Windows memory APIs](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Native/NativeMethods.cs): `RAMManager/Native/NativeMethods.cs`
- [Privilege handling](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Native/PrivilegeManager.cs): `RAMManager/Native/PrivilegeManager.cs`

### State and integrations

- [Audit history](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/HistoryService.cs): `RAMManager/Services/HistoryService.cs`
- [User preferences](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/SettingsService.cs): `RAMManager/Services/SettingsService.cs`
- [Theme service](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Services/ThemeService.cs): `RAMManager/Services/ThemeService.cs`
- [System tray](https://github.com/rapabru/ram-mannager/blob/main/RAMManager/Native/TrayIconManager.cs): `RAMManager/Native/TrayIconManager.cs`

### Other components

- **User**
- **Windows WMI**
- **Windows system**

## Connections

- User → Main window: uses
- Main window → Main coordinator: presents
- Main coordinator → Memory statistics: refreshes
- Main coordinator → Process analysis: queries
- Main coordinator → Growth sampling: records samples
- Main coordinator → Recommendations: requests guidance
- Main coordinator → Operation dispatcher: dispatches operations
- Main coordinator → User preferences: reads preferences
- Main coordinator → Theme service: applies theme
- Main coordinator → Overview: updates
- Main coordinator → Cleanup screen: updates
- Main coordinator → Process screen: updates
- Main coordinator → Diagnostics screen: updates
- Main coordinator → History screen: updates
- Main coordinator → Memory graph: updates
- Main coordinator → Leak investigator: updates
- Main coordinator → Floating monitor: exposes live data
- Main coordinator → System tray: provides quick actions
- Cleanup screen → Operation dispatcher: requests cleanup
- Memory statistics → Windows system: queries memory counters
- Process analysis → Windows system: enumerates processes
- Recommendations → Memory statistics: evaluates snapshot
- Growth sampling → Memory statistics: stores measurements
- Memory graph → Hardware details: loads hardware details
- Memory graph → Trend chart: displays samples
- Hardware details → Windows WMI: queries module data
- Operation dispatcher → Memory statistics: captures snapshots
- Operation dispatcher → Audit history: records result
- Operation dispatcher → Windows memory APIs: issues NT commands
- Operation dispatcher → Privilege handling: checks elevation
- Windows memory APIs → Windows system: invokes system APIs
- Privilege handling → Windows system: adjusts privileges
- History screen → Audit history: reads audit log
- User preferences → Theme service: supplies saved choice
- Theme service → Main window: updates appearance
- System tray → Main window: signals tray actions
