# igormundstein/winmemorycleaner architecture

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

- Interactive diagram: https://gitdiagram.com/igormundstein/winmemorycleaner
- Repository: https://github.com/igormundstein/winmemorycleaner

## Overview

Windows Memory Cleaner is a Windows RAM-monitoring and optimization app. Users view memory status and trigger optimization from the main window or tray; scheduled and low-memory optimization can also run through the Windows service. The computer service performs the selected native memory operations and reports results for display and notifications. The README also documents hotkeys, configuration, localization, themes, startup behavior, logging, and automatic updates. Some feature wiring is only documented or indexed, so unverified relationships are omitted or dashed.

Main entry points: [`src/ViewModel/MainViewModel.cs`](https://github.com/igormundstein/winmemorycleaner/blob/main/src/ViewModel/MainViewModel.cs) (Main view model), [`src/Service/ComputerService.cs`](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/ComputerService.cs) (Computer service), [`src/App.xaml.cs`](https://github.com/igormundstein/winmemorycleaner/blob/main/src/App.xaml.cs) (Application startup), [`src/Service/NotificationService.cs`](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/NotificationService.cs) (Tray notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and UI"]
  node_startup["Application startup<br/>[App.xaml.cs]"]
  node_mainui["Main window<br/>[MainWindow.xaml.cs]"]
  node_mainvm["Main view model<br/>[MainViewModel.cs]"]
  node_tray["Tray notifications"]
  node_traymenu["Tray menu"]
end

subgraph group_memory["Memory optimization"]
  node_computer["Computer service<br/>[ComputerService.cs]"]
  node_memorymodel["Memory status<br/>[Memory.cs]"]
end

subgraph group_support["Settings and support"]
  node_settings["Application settings<br/>[Settings.cs]"]
  node_localizer["Localization<br/>[Localizer.cs]"]
  node_language["Language model<br/>[Language.cs]"]
  node_themes["Theme manager<br/>[ThemeManager.cs]"]
  node_logs["Logging<br/>[Logger.cs]"]
  node_updater["Automatic updates<br/>[Updater.cs]"]
end

subgraph group_system["Windows integration"]
  node_native["Native Windows APIs<br/>[NativeMethods.cs]"]
  node_winservice["Scheduled optimization<br/>[WinService.cs]"]
  node_hotkey["Global hotkey<br/>[HotKeyService.cs]"]
end

node_user(("User"))
node_windows(("Windows"))

node_user -->|"uses"| node_mainui
node_mainui -->|"binds to"| node_mainvm
node_mainvm -->|"requests optimization"| node_computer
node_mainvm -.->|"presents status"| node_memorymodel
node_mainvm -->|"updates"| node_tray
node_tray -->|"creates menu"| node_traymenu
node_traymenu -.->|"triggers actions"| node_mainvm
node_computer -->|"calls APIs"| node_native
node_computer -->|"reads memory"| node_memorymodel
node_winservice -->|"requests optimization"| node_computer
node_winservice -->|"reads schedule"| node_settings
node_hotkey -->|"registers keys"| node_native
node_mainvm -.->|"configures hotkey"| node_hotkey
node_settings -->|"sets language"| node_localizer
node_localizer -->|"loads language"| node_language
node_mainvm -->|"uses themes"| node_themes
node_startup -->|"registers service"| node_computer
node_startup -->|"registers service"| node_tray
node_startup -.->|"loads settings"| node_settings
node_startup -->|"checks updates"| node_updater
node_computer -->|"records results"| node_logs
node_tray -->|"shows memory"| node_memorymodel
node_native -->|"invokes system APIs"| node_windows

click node_startup "https://github.com/igormundstein/winmemorycleaner/blob/main/src/App.xaml.cs"
click node_mainui "https://github.com/igormundstein/winmemorycleaner/blob/main/src/View/Window/MainWindow.xaml.cs"
click node_mainvm "https://github.com/igormundstein/winmemorycleaner/blob/main/src/ViewModel/MainViewModel.cs"
click node_tray "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/NotificationService.cs"
click node_traymenu "https://github.com/igormundstein/winmemorycleaner/blob/main/src/View/Control/TrayIconContextMenuControl.cs"
click node_computer "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/ComputerService.cs"
click node_memorymodel "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Model/Memory/Memory.cs"
click node_native "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Interop/NativeMethods.cs"
click node_winservice "https://github.com/igormundstein/winmemorycleaner/blob/main/src/WindowsService/WinService.cs"
click node_hotkey "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/HotKeyService.cs"
click node_settings "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Settings.cs"
click node_localizer "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Localizer.cs"
click node_language "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Model/Language.cs"
click node_themes "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/ThemeManager.cs"
click node_logs "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Logger.cs"
click node_updater "https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Updater.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_startup,node_mainui,node_mainvm,node_tray,node_traymenu,node_user toneBlue
class node_computer,node_memorymodel toneAmber
class node_settings,node_localizer,node_language,node_themes,node_logs,node_updater toneMint
class node_native,node_winservice,node_hotkey toneRose
class node_windows toneIndigo
```

## Components

### App and UI

- [Application startup](https://github.com/igormundstein/winmemorycleaner/blob/main/src/App.xaml.cs): `src/App.xaml.cs`
- [Main window](https://github.com/igormundstein/winmemorycleaner/blob/main/src/View/Window/MainWindow.xaml.cs): `src/View/Window/MainWindow.xaml.cs`
- [Main view model](https://github.com/igormundstein/winmemorycleaner/blob/main/src/ViewModel/MainViewModel.cs): `src/ViewModel/MainViewModel.cs`
- [Tray notifications](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/NotificationService.cs): `src/Service/NotificationService.cs`
- [Tray menu](https://github.com/igormundstein/winmemorycleaner/blob/main/src/View/Control/TrayIconContextMenuControl.cs): `src/View/Control/TrayIconContextMenuControl.cs`

### Memory optimization

- [Computer service](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/ComputerService.cs): `src/Service/ComputerService.cs`
- [Memory status](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Model/Memory/Memory.cs): `src/Model/Memory/Memory.cs`

### Settings and support

- [Application settings](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Settings.cs): `src/Core/Settings.cs`
- [Localization](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Localizer.cs): `src/Core/Localizer.cs`
- [Language model](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Model/Language.cs): `src/Model/Language.cs`
- [Theme manager](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/ThemeManager.cs): `src/Core/ThemeManager.cs`
- [Logging](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Logger.cs): `src/Core/Logger.cs`
- [Automatic updates](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Core/Updater.cs): `src/Core/Updater.cs`

### Windows integration

- [Native Windows APIs](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Interop/NativeMethods.cs): `src/Interop/NativeMethods.cs`
- [Scheduled optimization](https://github.com/igormundstein/winmemorycleaner/blob/main/src/WindowsService/WinService.cs): `src/WindowsService/WinService.cs`
- [Global hotkey](https://github.com/igormundstein/winmemorycleaner/blob/main/src/Service/HotKeyService.cs): `src/Service/HotKeyService.cs`

### Other components

- **User**
- **Windows**

## Connections

- User → Main window: uses
- Main window → Main view model: binds to (evidence: `src/View/Window/MainWindow.xaml.cs`)
- Main view model → Computer service: requests optimization (evidence: `src/ViewModel/MainViewModel.cs`)
- Main view model → Memory status: presents status (evidence: `src/ViewModel/MainViewModel.cs`)
- Main view model → Tray notifications: updates (evidence: `src/ViewModel/MainViewModel.cs`)
- Tray notifications → Tray menu: creates menu (evidence: `src/Service/NotificationService.cs`)
- Tray menu → Main view model: triggers actions
- Computer service → Native Windows APIs: calls APIs (evidence: `src/Service/ComputerService.cs`)
- Computer service → Memory status: reads memory (evidence: `src/Service/ComputerService.cs`)
- Scheduled optimization → Computer service: requests optimization (evidence: `src/WindowsService/WinService.cs`)
- Scheduled optimization → Application settings: reads schedule (evidence: `src/WindowsService/WinService.cs`)
- Global hotkey → Native Windows APIs: registers keys (evidence: `src/Service/HotKeyService.cs`)
- Main view model → Global hotkey: configures hotkey
- Application settings → Localization: sets language (evidence: `src/Core/Localizer.cs`)
- Localization → Language model: loads language (evidence: `src/Core/Localizer.cs`)
- Main view model → Theme manager: uses themes (evidence: `src/ViewModel/MainViewModel.cs`)
- Application startup → Computer service: registers service (evidence: `src/App.xaml.cs`)
- Application startup → Tray notifications: registers service (evidence: `src/App.xaml.cs`)
- Application startup → Application settings: loads settings (evidence: `src/App.xaml.cs`)
- Application startup → Automatic updates: checks updates (evidence: `src/App.xaml.cs`)
- Computer service → Logging: records results (evidence: `src/Service/ComputerService.cs`)
- Tray notifications → Memory status: shows memory (evidence: `src/Service/NotificationService.cs`)
- Native Windows APIs → Windows: invokes system APIs (evidence: `src/Interop/NativeMethods.cs`)
