• MackBook
  • AI
  • Memory usage

Boost up your MacBook performance and memory usage

LazyPanda

Learn practical methods to optimize your MacBook performance and reduce memory usage, especially when running heavy tasks, browser tabs, and AI workloads.

Boost up your MacBook performance and memory usage hero image

I have been using MackBook more than 10 years now, and I observed few challenges when to install new updates or to do long task like video edditing, running a with many tabs on browser or running some AI model to train. I have been using 2 Mac as of now, one is MacBook Pro 2025 (Apple M2) model and macBook Air 2020 model (Apple M1) both of them are doing great but MackBook Air gives such pain as it has low memory, so I have to be more cautious on installing software or doing my stuff on it. Here are my key points and verify the following 3 points before I make any decision to improve my Mac Performance.

Memory Usage in Activity Monitor

In Activity monitor app, you can check the graph of Memory utilization, if it shows yellow or red, good to close unused apps or browser tabs. Then good to restart the system. Then check again possibly you could notice the Memory utilization graph is green now.

activity monitor on memory usage

  • Green - Your Mac is managing its memory efficiently. No need to clear RAM.

  • Yellow - Available memory is becoming limited. If performance slows, close unused apps or restart your Mac.

  • Red - Your Mac needs more memory for its current workload. Close apps which are not in used, reduce the number of open browser tabs tabs.


Check on Mac Storage

Memory is just one of many things that can cause a Mac run slow. Low storage space, too many apps opening at startup, or outdated software can slow your Mac down even when memory usage looks fine.

You can check the mac disk size from Settings. And it looks some thing like below - (Settings > General > Storage)

mac storage

I found a way to clear unused junk data those are created in background during overtime of your mac usage. There are two way you can clean the junk data which you are not able to locate them properly. I used OpenCode CLI (AI tool) and use the prompt to find out the large unused files and remove them after my review. It works perfectly, but there is a concern on your data as those are going to be parsed by AI tool. If you are okay with this, you can install openCode CLI tool and give the prompt to clear the junk data after your review.

Here you can find how to install OpenCode and that is free as of now.

The Next one, I build a python script to find the list of big files and how to clean them as well. To do that first download the script and keep this in some floder, let's say "Script".

Step 1:

cleanup_large_files.py is a small tool that shows you which files and folders are using the most space, asks you which ones to remove, and then prints a report of what happened.

Gist file - cleanup_large_files.py

It never deletes anything on its own. It will not touch your documents, projects, passwords, browser profiles, or system files.

Step 2:

Requires Python 3.10+ and standard library only. No pip install needed. Directory sizes are the sum of allocated file blocks (st_blocks × 512), so sparse files are reported accurately. Scanning is iterative (no recursion limit) and skips symlinks.

A normal first run looks like this:

  1. Open Terminal (Applications → Utilities → Terminal, or press ⌘Space and type Terminal).

  2. Copy this line and press Return:

python3 ~/Scripts/cleanup_large_files.py --dry-run --min-mb 200 --top 40

This is a practice run: it only shows a list and changes nothing.

Understanding the list

You will see a table like this:

#        SIZE  TYPE       RISK  MODIFIED    PATH
   1     2.2 GiB  DIR      REVIEW  2024-10-15  /Users/you/Library/Android/sdk
   2     1.6 GiB  DIR        SAFE  2026-11-30  /Users/you/Library/Caches/Example
   3     3.7 GiB  DIR   PROTECTED  2026-11-30  /Users/you/Workload

Column

Meaning

SIZE

How much disk space the item actually uses.

TYPE

DIR = folder, FILE = single file.

MODIFIED

Date the item was last changed.

PATH

Exact location.

RISK

How safe the tool considers deletion (see below).

  1. Read the list. When you are comfortable, run the real thing:

python3 ~/Scripts/cleanup_large_files.py --min-mb 200 --top 40

Choosing what to delete

After the list, you will be asked:

Select entries to delete (numbers, comma separated;
's' = all SAFE, 'r' = all REVIEW, 'n' = none):

Your options:

You type

What happens

1, or 1,3,7

Select one or several numbered lines.

s

Select every SAFE item in the list. Easiest and safest choice.

r

Select every REVIEW item. Only do this if you recognise them.

n or just Return

Delete nothing and exit.

q

Quit without changes.

If you type the number of a PROTECTED item, the script ignores it and tells you why.

Next, the script shows the exact items you chose and asks:

Type DELETE to permanently remove these entries:

Then you will get the report as well, like below screenshot.

terminal image

I hope you can free some junk memory and give a rebirth of your laptop.

Enjoy surfing!

Loading comments...

LazyPanda

Sync up on the latest from LazyPanda.

The truth is, most of us DISCOVER where we are heading when we ARRIVE.

Colour theme
Appearance