Description
PC/ Mac / Linux / Steam Deck: 100% Compatible.
Android: Partially Compatible:
- What Works: "Auto-Clear at Sleep" and "Manual Purge" will work fine.
- Please disable Enable RAM threshold when using it
Description
Stardew Valley loves to load textures into RAM and keep them there, even if you haven't seen that specific item or map in hours. For vanilla players, this is fine. For players with 200+ mods, huge expansion packs, and high-res sprites, this leads to "Memory Creep" and eventual Out-Of-Memory crashes.
Stardew Texture Cache Purge forces the game to release these unused textures from memory. It includes a "Smart Filter" to ensure critical UI elements (like your cursor, fonts, and controller maps) are NOT purged, preventing the UI from flickering or lagging when the cache is cleared.

Benefit:
Here are the specific benefits:
1. Frees Wasted RAM
Stardew Valley has a habit of loading a texture (like a character portrait or a map tileset) and keeping it in memory forever, even if you never see it again that session. This mod flushes that junk out, freeing up hundreds of megabytes of RAM.
2. Fixes Visual Glitches ("Purple Squares")
Sometimes mods conflict or glitch out, causing items to turn into purple squares or static. Pressing the Manual Purge Key forces the game to reload those images, often fixing the visual bug instantly without needing to restart the game.
3. "Fresh Start" Every In-Game Day
By using the Auto-Clear at Sleep feature, the mod cleans up your memory every time your farmer goes to bed. This means every new day starts with low memory usage, preventing the game from getting slower and slower as you play.
4. Saves Long Play Sessions
If you play for 3+ hours at a time, the game usually gets laggy. This mod extends your playtime by keeping the memory footprint low, so you don't have to restart the game just to get performance back.

Features
1. Auto-Clear at Sleep (Recommended)
- Runs automatically when your farmer goes to bed.
- Clears all non-essential textures from the previous day.
- Ensures every new day starts with a fresh, low RAM footprint.
- Zero impact on gameplay smoothness since it happens during the save screen.
2. Manual Purge Key
- Press a hotkey (Default: O) to instantly flush the texture cache.
- Excellent for fixing visual glitches (like sprites turning into "purple squares" or loading the wrong texture) without restarting the game.
3. RAM Usage Threshold (Optional)
- Monitors your RAM usage. If it exceeds a limit you set (e.g., 2GB), it forces a purge.
- Note: This is a "Sledgehammer" fix. It causes a momentary freeze while the memory is dumped. It includes a safety cooldown to prevent it from looping.

Stardew Stabilizer Compatibility
This mod works perfectly alongside Stardew Stabilizer. They perform different tasks:
- Stardew Stabilizer: Acts like a janitor, constantly organizing memory in the background to prevent stutter.
- Texture Cache Purge: Acts like a demolition crew, completely dumping old image data.
Recommended Setup if using both:
- Keep Auto-Clear at Sleep ENABLED (This mod handles the overnight cleaning).
- Keep Manual Key ENABLED (For fixing visual bugs).
- DISABLE the "RAM Threshold" in this mod. Let Stardew Stabilizer handle active gameplay memory management to avoid freezes.
Configuration
This mod supports Generic Mod Config Menu (GMCM) for easy in-game settings.
- Auto-Clear at Sleep: true/false
- Manual Purge Key: Keybind
- Enable RAM Threshold: true/false (Default: false)
- RAM Limit (MB): Set the trigger point for the auto-purge.
Installation
- Install SMAPI.
- Download this mod and unzip it into your Stardew Valley/Mods folder.
- Run the game.
Safe to uninstall anytime. Removing it just disables the features.
https://www.nexusmods.com/profile/ZeroXPatch/mods?gameId=1303&sortBy=endorsements


