Skip to content

Repository files navigation

RAM Cleaner

RAM Cleaner is a lightweight Windows desktop utility built with C# and WPF (.NET Framework 4.8) for reclaiming physical memory on demand.

Platform Framework Language UI License

Overview

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.

Features

  • 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.

Screenshots

RAM Cleaner 1 RAM Cleaner 2

Getting Started

Prerequisites

  • 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

Build from source

  1. Clone the repository:
    git clone https://github.com/xecvas/RAM-Cleaner.git
    cd RAM-Cleaner
  2. Open RAM Cleaner.sln in Visual Studio.
  3. Build the solution (Ctrl+Shift+B) or publish a Release build.
  4. Run RAM Cleaner.exe from bin/Release (or bin/Debug). Windows will prompt for elevation on launch — this is expected.

Download a release

Alternatively, download the latest pre-built executable from the Releases page and run RAM Cleaner.exe directly — no installation required.

Usage

  1. Launch RAM Cleaner. On first run, a short dialog explains exactly what Optimize does — dismiss it with Got it.
  2. 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.
  3. 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.
  4. 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.

Project Structure

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

Built With

  • 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/GetWindowLongPtr for fullscreen detection, and related Win32 APIs
  • Task Scheduler (schtasks.exe) for elevated, prompt-free autostart
  • System.Windows.Forms.NotifyIcon for system tray integration
  • System.Threading.Tasks — background-thread optimize and process enumeration, keeping the UI responsive

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m "Add my feature").
  4. Push to the branch (git push origin feature/my-feature).
  5. 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.

License

This project is licensed under the terms found in LICENSE.txt.

Author

Created with ❤️ by your-username

About

RAM Cleaner is a lightweight Windows desktop utility built with C# and WPF (.NET Framework 4.8) for reclaiming physical memory on demand.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages