Skip to content

A fully automated script that can monitor Raycast's memory usage on the macOS system at regular intervals and restart it.

License

Notifications You must be signed in to change notification settings

ManicEuphoria/raycast_mem_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raycast Memory Monitor

A lightweight macOS shell script that automatically monitors and manages Raycast’s memory usage. If Raycast consumes more than a defined memory threshold (default: 500 MB), the script will automatically restart the app and notify the user.

Features

  • Monitors Raycast’s memory usage periodically

  • Automatically restarts Raycast when memory exceeds threshold

  • Sends macOS system notifications on restart (optional if IBM Notifier is installed)

  • Writes detailed logs for each check

  • Runs automatically via macOS LaunchAgent (no manual execution needed)

Configuration

Setting Description Default
APP_NAME Application name to monitor Raycast
MEM_THRESHOLD_MB Memory threshold (in MB) before restart 500
LOG_FILE Path to the log file ~/raycast_mem_monitor.log
StartInterval Memory check frequency 3600

Installation

  1. Copy the script
vi ~/raycast_mem_monitor.sh

Paste the script content and save.

  1. Make it executable
chmod +x ~/raycast_mem_monitor.sh
  1. Create the LaunchAgent
vi ~/Library/LaunchAgents/com.user.raycastmem.plist

Paste the script content and change [USERNAME] to your device name.

  1. Load the task
launchctl load ~/Library/LaunchAgents/com.user.raycastmem.plist

Logs

All activity is logged to:

~/raycast_mem_monitor.log

Each entry includes a timestamp, current memory usage, and restart actions.

Notifications

If you want to use system notification, please install IBM Notifier.

English Notification:
English Notification

Chinese Notification:
Chinese Notification

Notes

  • Modify StartInterval to change the check frequency (e.g., 3600 = 1 hour).

  • Modify MEM_THRESHOLD_MB to meet your management needs.

  • To stop the service:

launchctl unload ~/Library/LaunchAgents/com.user.raycastmem.plist

License

MIT License — free to use and modify. Developed with ❤️ for a smoother Raycast experience.

About

A fully automated script that can monitor Raycast's memory usage on the macOS system at regular intervals and restart it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages