Skip to content

Commit

Permalink
Windows Memory Cleaner 2.0 (#9)
Browse files Browse the repository at this point in the history
* - Code cleaning and optimizations.
- New icon.
- Windows Server 2003 and Windows XP 64-Bit support.

* - Code improvements

* - Added system tray + notification
- Code improvements and cleaning

* Code analyzers and improvements

* Code and Log improvements

* Auto-update

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Code refactoring

* Update README.md

* Dark UI & DI refactor

* Folder structure update

* - Code refactor
- New settings
- UI changes

* Update README.md

* Version 2.0

* Auto Optimization

* Localization (English/Portuguese)

* Languages combo box

* Run On Startup

* Delete SECURITY.md

* Delete custom.md

* Update .gitignore

* Update .gitattributes

* Delete FUNDING.yml

* Delete shortcut-command-arguments.png

* Add files via upload

* Delete main-window.png

* Add files via upload

* Add files via upload

* Delete CONTRIBUTING.md

* Add files via upload

* Add files via upload

* Add files via upload

* Update README.md

* Add files via upload

* Update README.md

* Update README.md

* Update README.md
  • Loading branch information
IgorMundstein authored Mar 26, 2023
1 parent bf85eca commit 2cb3dd1
Show file tree
Hide file tree
Showing 65 changed files with 3,442 additions and 13,030 deletions.
71 changes: 13 additions & 58 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,63 +1,18 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
# Auto detect text files and perform LF normalization
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
# C#
*.cs text diff=csharp
*.csproj text eol=crlf
*.sln text eol=crlf

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
# Graphics
*.ico binary
*.png binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
# Serialisation
*.json text

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
# Exclude files from exporting
.gitattributes export-ignore
.gitignore export-ignore
Binary file added .github/images/download-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/main-window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/win-memory-cleaner-24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/win-memory-cleaner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/windows-event-log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 37 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand Down Expand Up @@ -90,6 +90,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -293,6 +294,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -349,6 +361,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -360,3 +375,24 @@ MigrationBackup/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml
88 changes: 73 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,94 @@
# Windows Memory Cleaner
[![](https://img.shields.io/badge/Windows-Vista%20|%207%20|%208%20|%2010%20|%2011-blue?style=for-the-badge)](#)
[![](https://img.shields.io/badge/Windows%20Server-2008%20|%202012%20|%202016%20|%202019%20|%202022-blue?style=for-the-badge)](#)
<div align="center">
<h1>Windows Memory Cleaner</h1>

[![](https://img.shields.io/github/license/IgorMundstein/WinMemoryCleaner?style=for-the-badge)](#)
[![](https://img.shields.io/github/downloads/IgorMundstein/WinMemoryCleaner/total?style=for-the-badge)](#)
[![](https://img.shields.io/badge/Windows-XP%20%7C%20Vista%20%7C%207%20%7C%208%20%7C%2010%20%7C%2011-blue?style=for-the-badge)](#)
[![](https://img.shields.io/badge/Server-2003%20%7C%202008%20%7C%202012%20%7C%202016%20%7C%202019%20%7C%202022-blue?style=for-the-badge)](#)

The app is a free RAM cleaner. There are times when programs do not release the memory they used, making the machine slow, but you don’t want to restart the system to get the used memory back. That is where you use Windows Memory Cleaner to clean your memory, so you can carry on working without wasting time restarting your Windows.
[![](https://img.shields.io/github/license/IgorMundstein/WinMemoryCleaner?style=for-the-badge)](#)
[![](https://img.shields.io/github/downloads/IgorMundstein/WinMemoryCleaner/total?style=for-the-badge)](#)

[![Download)](https://img.shields.io/github/v/release/IgorMundstein/WinMemoryCleaner?color=red&label=DOWNLOAD&logo=windows)](https://github.com/IgorMundstein/WinMemoryCleaner/releases/latest/download/WinMemoryCleaner.zip)
[![](/.github/images/main-window.png)](#)

## 🚀 How it works
![](https://raw.githubusercontent.com/IgorMundstein/WinMemoryCleaner/master/docs/main-window.png)
<p align="justify">
This free RAM cleaner uses native Windows features to clear memory areas. Sometimes, programs do not release the allocated memory, making the computer slow. That is when you use Windows Memory Cleaner to optimize the memory, so you can keep working without wasting time restarting your system.
</p>

It's portable, so you do not have to bother with installation or configuration. Download and open the executable to get started. The app requires **administrator** privileges to run and comes with a minimalistic interface; before you clean up memory, you should go through the list and check the areas you want the app to analyze.
<p align="justify">
It's portable, so you do not need installation or configuration. Download and open the executable to get started. The app requires administrator privileges and has a minimalistic interface and smart features.
</p>

It gives you the ability to clean up the memory in 6 different ways:
[![Download)](/.github/images/download-button.png)](https://github.com/IgorMundstein/WinMemoryCleaner/releases/latest/download/WinMemoryCleaner.zip)
</div>

- `Clean Combined Page List` - Flushes blocks from the combined page list.
## 🚀 Features

### Auto optimization

- `Every X hours` - The optimization will run by period. 0h disables it.
- `When free memory is below X percent` - The optimization will run if free memory is below the specified percentage. 0% disables it.

### Memory Areas

- `Clean Combined Page List` - Flushes blocks from the combined page list. Effective only when page combining is enabled.
- `Clean Modified Page List` - Flushes memory from the Modified page list, writing unsaved data to disk and moving the pages to the Standby list.
- `Clean Processes Working Set` - Removes memory from all user-mode and system working sets and moves it to the Standby or Modified page lists. Note that by the time, processes that run any code will necessarily populate their working sets to do so.
- `Clean Standby List` - Flushes pages from all Standby list to the Free list.
- `Clean Standby List (Low Priority)` - Flushes pages from the lowest-priority Standby list to the Free list.
- `Clean System Working Set` - Removes memory from the system cache working set.

### Multi-Language

- `English` `Portuguese`

### Processes excluded from optimization

- Allows the user to create a list of processes that will be ignored when memory is optimized.

### Settings

- `Always on top` - Pins the window to the top of all your windows.
- `Auto update` - Keeps the app up to date.
- `Minimize to the tray when closed` - Minimize the app to the system tray when clicking the close (X) button.
- `Run on startup` - Runs the app after the system boots up.
- `Show optimization notifications` - Sends a message to the notification area after optimization.
- `Start minimized` - The app will start minimized to the system tray. Single/Double click on the icon to restore.

## 🖥️ Command arguments (NO GUI)

The arguments below can be used to run the program silently.

`/CombinedPageList` `/ModifiedPageList` `/ProcessesWorkingSet` `/StandbyList` `/StandbyListLowPriority` `/SystemWorkingSet`
- `/CombinedPageList`
- `/ModifiedPageList`
- `/ProcessesWorkingSet`
- `/StandbyList` OR `/StandbyListLowPriority`
- `/SystemWorkingSet`

Example

![](https://raw.githubusercontent.com/IgorMundstein/WinMemoryCleaner/master/docs/shortcut-command-arguments.png)
`WinMemoryCleaner.exe /ModifiedPageList /ProcessesWorkingSet /StandbyList /SystemWorkingSet`

## 📖 Logs

Logs are saved on windows event.

![](https://raw.githubusercontent.com/IgorMundstein/WinMemoryCleaner/master/docs/windows-event-log.png)
1. Press **Win + R** to open the Run command dialog box.
2. Type **eventvwr** and press **Enter** to open the Event Viewer.

[![](/.github/images/windows-event-log.png)](#)

## 📝 Development notes

Project requirements.

- Microsoft.NET 4 framework version for Windows retro compatibility
- Minimalistic user interface
- Model-View-ViewModel (MVVM) design pattern
- No third library or DLL dependencies
- S.O.L.I.D. Principles of Object-Oriented
- Use of Windows native methods for memory management
- Windows Presentation Foundation (WPF) for user interface
- Windows Registry to save user config

## 🌐 Translation

If you are a native speaker of any language other than English, you can contribute by translating the file: [English.json](/src/Resources/Localization/English.json)
Binary file removed docs/main-window.png
Binary file not shown.
Binary file removed docs/shortcut-command-arguments.png
Binary file not shown.
Binary file removed docs/windows-event-log.png
Binary file not shown.
104 changes: 101 additions & 3 deletions src/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,108 @@

<Application.Resources>
<ResourceDictionary>
<local:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<local:EnumBooleanConverter x:Key="EnumBooleanConverter" />
<!-- Converters -->
<local:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
<local:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<local:MainViewModel x:Key="MainViewModel" />
<local:ViewModelLocator x:Key="ViewModelLocator" />
<!-- Colors -->
<SolidColorBrush x:Key="DarkBackground" Color="#202020" />
<SolidColorBrush x:Key="DarkBorderBrush" Color="#2B2B2B" />
<SolidColorBrush x:Key="DarkControlBackground" Color="#2C2C2C" />
<SolidColorBrush x:Key="DarkControlDisabled" Color="#999999" />
<SolidColorBrush x:Key="DarkControlForeground" Color="#D3D3D3" />
<SolidColorBrush x:Key="DarkControlOver" Color="#00AEF7" />
<SolidColorBrush x:Key="DarkForeground" Color="#FFFFFF" />
<!-- Styles -->
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="{StaticResource DarkControlBackground}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="{StaticResource DarkForeground}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="3, 0, 3, 0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{StaticResource DarkControlBackground}" />
<Setter Property="Foreground" Value="{StaticResource DarkControlDisabled}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{StaticResource DarkControlOver}" />
</Trigger>
</Style.Triggers>
<Style.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="3" />
</Style>
</Style.Resources>
</Style>
<Style TargetType="{x:Type CheckBox}">
<Setter Property="Foreground" Value="{StaticResource DarkForeground}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource DarkControlDisabled}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{StaticResource DarkForeground}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type GroupBox}">
<Setter Property="Background" Value="{StaticResource DarkControlBackground}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Foreground="{StaticResource DarkControlForeground}"
FontWeight="Normal"
Text="{Binding}" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="3, 10, 3, 3" />
</Style>
<Style TargetType="{x:Type Hyperlink}">
<Setter Property="Foreground" Value="{StaticResource DarkControlForeground}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{StaticResource DarkControlOver}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type ItemsControl}">
<Style.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="3" />
</Style>
</Style.Resources>
</Style>
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="1" />
</Style>
</Style.Resources>
</Style>
<Style TargetType="{x:Type ToolTip}">
<Setter Property="Background" Value="{StaticResource DarkBackground}" />
<Setter Property="Foreground" Value="{StaticResource DarkForeground}" />
</Style>
</ResourceDictionary>
</Application.Resources>

Expand Down
Loading

0 comments on commit 2cb3dd1

Please sign in to comment.