RAM Cleaner is a lightweight Windows desktop utility built with C# and WPF (.NET Framework 4.8) for reclaiming physical memory on demand.
It trims the working set of every running process and purges the Windows standby memory list with a single click, on a schedule, or automatically once usage crosses a threshold you set — all wrapped in a clean, frameless, modern UI that lives quietly in the system tray.
- One-click Optimize — trims every reachable process's working set and purges the OS standby memory list, so "Available" memory jumps up immediately. Runs elevated for full effect.
- Live memory info — Total / Used / Free physical memory, refreshed on a configurable interval.
- Progress bar or history chart — switch between a simple usage bar and a rolling sparkline chart of recent memory usage, whichever you prefer.
- Auto-optimize on a schedule or threshold — automatically clean at a fixed interval (seconds or minutes), when usage exceeds a percentage you choose, or both.
- Fullscreen-aware — automatically skips scheduled/threshold cleans while a real fullscreen app (game, video player, presentation) is active, so it never causes a stutter mid-session. Distinguishes genuine fullscreen from an ordinary maximized window, and can be turned off if you'd rather it always run.
- Process exclusion list — keep specific processes untouched by typing an exe name or picking one straight from the list of currently running processes.
- Start with Windows — registers as a Scheduled Task (not the registry Run key) so it launches elevated at logon without a repeat UAC prompt every time.
- Launch minimized — start straight in the system tray with no window flash, if you'd rather it just be there when you need it.
- System tray integration — right-click menu for Open / Optimize now / Exit, plus a balloon notification when an automatic optimize runs while the window is hidden.
- "Last optimized" indicator — shows how long it had been since your previous optimize, right in the main window.
- First-run explainer — a plain-language, one-time dialog describing exactly what Optimize does before you ever click it.
- Custom window chrome — frameless, draggable title bar for a clean, modern look.
- Windows 10 or 11
- .NET Framework 4.8 (typically pre-installed on modern Windows)
- Visual Studio 2019/2022 with the .NET desktop development workload (only required to build from source)
- Administrator rights — the app always runs elevated, since trimming other processes' working sets and purging the standby list both require it
- Clone the repository:
git clone https://github.com/xecvas/RAM-Cleaner.git cd RAM-Cleaner - Open
RAM Cleaner.slnin Visual Studio. - Build the solution (
Ctrl+Shift+B) or publish aReleasebuild. - Run
RAM Cleaner.exefrombin/Release(orbin/Debug). Windows will prompt for elevation on launch — this is expected.
Alternatively, download the latest pre-built executable from the Releases page and run RAM Cleaner.exe directly — no installation required.
- Launch RAM Cleaner. On first run, a short dialog explains exactly what Optimize does — dismiss it with Got it.
- Click Optimize any time to trim memory immediately. The amount recovered, and how long it had been since your last optimize, briefly appear at the bottom of the window.
- Open Options to configure:
- Auto-optimize every — clean automatically on a fixed interval (seconds or minutes).
- Auto-optimize when usage exceeds (%) — clean automatically once usage crosses a percentage you set.
- Don't optimize during fullscreen apps — leave on to avoid interrupting games/video, or turn off if you want auto-optimize to always run.
- Exclude processes in this list — type an exe name (e.g.
chrome.exe) or click Pick from running processes... to choose one from what's currently open. - Refresh interval — how often the memory display updates.
- Show display in chart — switch the main window between a progress bar and a usage history chart.
- Start with Windows / Launch minimized at startup / Minimize to system tray instead of closing.
- Close the window (or minimize it, if enabled) to send RAM Cleaner to the system tray — right-click the tray icon for Open, Optimize now, or Exit.
RAM Cleaner/
├── Services/
│ ├── AppSettings.cs # Settings persistence (%AppData%) + Scheduled Task autostart
│ ├── FullscreenDetector.cs # Detects a genuine fullscreen foreground app
│ ├── MemoryOptimizer.cs # Core optimize logic — working-set trim + standby purge
│ ├── MemoryStatus.cs # Formatted memory snapshot for display binding
│ └── Native.cs # Centralized P/Invoke declarations
├── App.xaml / App.xaml.cs # Application entry point, single-instance guard
├── MainWindow.xaml / .xaml.cs # Main window and interaction logic
├── OptionsWindow.xaml / .xaml.cs# Settings dialog
├── AboutWindow.xaml / .xaml.cs # About dialog
├── FirstRunWindow.xaml / .xaml.cs # First-run explainer dialog
└── app.manifest # Requests admin elevation + DPI awareness
- C# / WPF on .NET Framework 4.8
- Native user32.dll / kernel32.dll / psapi.dll / ntdll.dll / advapi32.dll P/Invoke —
GlobalMemoryStatusEx,EmptyWorkingSet,NtSetSystemInformation,GetForegroundWindow/GetWindowRect/GetMonitorInfo/GetWindowLongPtrfor fullscreen detection, and related Win32 APIs - Task Scheduler (
schtasks.exe) for elevated, prompt-free autostart System.Windows.Forms.NotifyIconfor system tray integrationSystem.Threading.Tasks— background-thread optimize and process enumeration, keeping the UI responsive
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/my-feature). - Commit your changes (
git commit -m "Add my feature"). - Push to the branch (
git push origin feature/my-feature). - Open a Pull Request.
Please keep changes consistent with the existing .NET Framework 4.8 / WPF target and avoid introducing dependencies on newer .NET runtimes.
This project is licensed under the terms found in LICENSE.txt.
Created with ❤️ by your-username

