% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/memory_sweeper.R
\name{sweep_memory}
\alias{sweep_memory}
\title{Interactive Memory Sweeper}
\usage{
sweep_memory()
}
\value{
Invisibly returns a named list with components: \code{status} ("done",
"clean", or "cancelled"), \code{threshold_mb} (numeric), and
\code{objects_removed} (character vector of removed object names).
}
\description{
Scans the global environment for memory-intensive objects and interactively 
prompts the user to remove them to free up system RAM.
}
\details{
The function implements a simple memory management workflow:
\enumerate{
  \item Prompts the user to define a size threshold (in MB) for flagging objects.
  \item Calculates the size of all objects currently residing in the global environment.
  \item Identifies and sorts objects that exceed the specified threshold.
  \item Presents a selection menu allowing the user to choose one or more large 
      objects for removal.
  \item Executes `rm()` on the selected objects and immediately calls `gc()` 
      to ensure the memory is released back to the system.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  sweep_memory()
}
}
