A lightweight Windows utility that combines temp-folder cleanup with RAM-size-aware scripts so users can free disk clutter and nudge available memory without digging through system folders.
Snapshot
Field
Details
Type
Windows desktop utility
Context
Personal Project
Role
Solo developer
Year
2018
Status
Completed personal release (v1.0)
Main focus
Temp cleanup, RAM profile selection, and scripted memory release
Overview
CleanRam is a Java Swing desktop app I built in early 2019 while I was learning Java and desktop tooling on Windows. The idea was practical and narrow: give non-technical users a single window with three clear actions instead of hunting through %temp% folders or guessing which cleanup script fits their RAM.
The project is a personal utility, not a commercial product. I keep it in my portfolio because it shows how I approached a real machine problem with a simple GUI, file persistence, and small OS-level scripts, even when the implementation still reflects early Java habits I would refactor today.
The problem
On older or heavily used Windows PCs, temporary files pile up and background processes can make the machine feel sluggish. Many people know something is wrong but do not know which folders are safe to clear or how to run maintenance without breaking something.
%temp% and user temp paths fill with leftover installers, caches, and crash dumps.
Available RAM can feel tight during everyday multitasking, especially on lower-memory machines.
Built-in tools are scattered, and command-line cleanup is intimidating for casual users.
Who it was for
Windows users who wanted a one-click way to clear temp files.
People comfortable clicking buttons but not editing batch files or registry entries.
My own learning use case: a small, shippable desktop app with icons, dialogs, and OS integration.
My role
I designed and built the entire project end to end: the main window and RAM selection dialog in NetBeans Form Editor, recursive temp deletion in Java, persistence of the user's RAM choice under %APPDATA%, and a set of VBE helper scripts scaled from 1 GB through 128 GB. I also packaged the app as a runnable JAR and wrote the project README.
What the project does
CleanRam opens a fixed-size Spanish-language window with three large actions. Users first configure how much RAM their PC has, then they can run a matching cleanup script or wipe the Java temp directory from the same UI.
Configure RAM size opens a secondary dialog with preset options (1 GB through 128 GB) and saves the choice locally.
Release RAM reads that saved value and launches the corresponding VBE script through cscript.
Clear temp files recursively deletes files under the JVM temp directory and confirms success in a dialog.
Visual shell uses custom backgrounds and icons so the tool feels intentional rather than like a raw script launcher.
Distribution targets Java 8+ and ships as Cleanram.jar from the NetBeans dist output.
Key features
RAM size profile
A dedicated dialog lets the user pick one of ten memory tiers. The selection is written to a small text file so the main window can run the right script later without asking again.
java
if(i==0){
a.Escribir(arcf, "1");
}
// ... tiers through 128 GB ...
JOptionPane.showMessageDialog(null, "Se ha configurado el tamaño de RAM correctamente","CleanRam",JOptionPane.INFORMATION_MESSAGE);
I chose file-based persistence instead of registry keys because it was easy to debug as a beginner and kept the logic visible on disk.
Temp folder cleanup
The clear-temp action walks the JVM temp directory recursively and deletes files and nested folders before showing a confirmation dialog.
java
public void borrarDirectorio(File directory){
File[] ficheros = directory.listFiles();
for(int x=0;x<ficheros.length;x++){
if (ficheros[x].isDirectory()){
borrarDirectorio (ficheros [x]);
}
ficheros[x].delete();
}
}
I surfaced a short "Eliminando..." label during the operation so the UI did not feel frozen even though the work is synchronous.
RAM release scripts
Each RAM tier maps to a VBE file that sets a Mystring buffer sized for that memory class. Java reads the saved tier and executes the matching script.
java
linea = br.readLine();
if(linea=="4")
Runtime.getRuntime().exec( "cscript com/giusniyyel/cleanram/v1/util/free4gb.vbe");
The scripts stay outside the JAR so I could tune sizes without recompiling the UI, at the cost of fragile working-directory assumptions.
Technical approach
The app is a standard NetBeans Ant project targeting Java 8. The entry point is CleanRam_es, built with Swing and the Nimbus look and feel. I split responsibilities across three Java classes: the main frame for actions, CleanRam_es_TM for RAM selection, and Archivo for read/write of the profile file.
Persistence lives under the user's %APPDATA% tree. The RAM dialog writes a numeric code (1, 2, 4, … 128) to ramsize.txt. The main window checks that the file exists before attempting a RAM release; if it is missing, the user gets a direct error asking them to configure RAM first.
OS integration uses Runtime.getRuntime().exec() to call cscript on the bundled .vbe files. Temp cleanup uses System.getProperty("java.io.tmpdir") rather than hard-coded drive letters, which keeps that path portable across user accounts. A separate freetemp.bat in the util folder targets classic Windows temp locations for manual or alternate use.
There is no automated test suite and no installer pipeline in this version. Distribution is the built JAR plus bundled util assets, as described in the dist notes.
Design decisions
I optimized for clarity over flexibility: three large image buttons on a 1024×600 layout, Spanish copy, and modal dialogs for every outcome.
Fixed window size and non-resizable frames so the custom artwork always aligned.
Icon-driven buttons (TM, LR, LC) so actions are recognizable at a glance.
Separate RAM configuration window so the main screen stays uncluttered.
JOptionPane feedback for success and failure instead of a log panel.
Preset RAM buckets instead of reading hardware automatically, which avoided WMI complexity at the time.
Challenges and tradeoffs
Windows-only coupling: VBE scripts, %APPDATA% paths, and cscript assume Windows; the app was never meant to run cross-platform.
Script path fragility: RAM release depends on the process working directory resolving com/giusniyyel/cleanram/v1/util/..., which breaks easily if the JAR is launched from another folder.
Folder naming inconsistency: configuration code creates GiusNiyyel\CleanRam while the reader looks for giusniyyel\cleanram, which can prevent the release action from finding the saved profile on case-sensitive comparisons.
String comparison in Archivo.Leer: using == on linea from BufferedReader is unreliable in Java; .equals() would be the correct check.
Synchronous deletion: large temp trees block the UI thread; a background task with progress would be safer today.
Honest scope: this frees temp clutter and runs a script pattern aimed at memory pressure; it is not a kernel-level memory manager.
What I learned
Building CleanRam taught me how desktop apps bridge user intent and OS behavior. I had to think about where files live on a real machine, how to bundle helpers with a JAR, and how to communicate errors in plain language instead of stack traces.
I got comfortable with Swing layout, custom icons, and multi-window flows.
I learned that small path and string bugs have outsized impact in file-driven utilities.
I saw why separating UI, persistence, and script execution makes later fixes easier even in a tiny codebase.
Current status
This project is no longer actively maintained. Version 1.0.0 is a completed personal release I built while learning Java, and I treat it as stable but dated. I keep it in my portfolio as an honest snapshot of early desktop work, not as production system software.
If I revisited this today
Replace == string checks with .equals() and add basic unit tests around Archivo read/write.
Unify %APPDATA% folder casing and resolve script paths from the JAR classpath or ProcessBuilder with absolute paths.
Run temp deletion on a background worker with cancel support and safer error handling for locked files.
Detect installed RAM programmatically (or read OS metrics) instead of manual tier selection.
Modernize packaging with jpackage or an installer, and add structured logging instead of only JOptionPanes.
Re-evaluate the VBE memory technique against documented, supported Windows maintenance APIs before recommending it to anyone else.