'System Storage Taking Up Way Too Much Space in macOS Mojave [closed]

My mac is sending me the frequent alert of low disk space. When I am checking the system storage then it's showing 170+gb is occupied by the system. I am not sure where is my space is getting used?

I tried a few cleaner tools also but couldn't get help much.

Please help to resolve it?

enter image description here



Solution 1:[1]

After doing research over various forums of mac's and StackExchange I figured out that it's mostly because of the following reasons.

  1. Log files (Might be crash log files/docker files)
  2. Your email messages stored in outlook (in my case it was almost ~20 GB)
  3. Logs related to cores when a system restarts (~ 10 GB)
  4. Docker Images (This had ~70 GB in my case).
  5. Your nonsystem documents/downloads/itunes

So the question is how to find what all things are unnecessary and safe to delete? These system files are not visible directly.

I tried using a few tools like cleanmymac etc but all were paid so I couldn't get help much there.

To clean up your non-system unnecessary files, you can directly take the help of the storage management tool of mac. You just have to click on optimize storage and it will show all the non-system files.

enter image description here

To cleanup unnecessary system files, use below command

sudo find -x / -type f -size +10G

This command will give you all the files occupying more than 10 GB. You can analyze the files and delete them enter image description hereas necessary.

The highlighted cores are nothing but the state files of your mac to reboot from last state when your mac restarts so it's safe to delete.

Next step is to delete a hidden tmp folder enter image description here

It will show the size as 0 bytes because your user won't have permission to read it. But will be occupying a hell amount of space. So delete it by giving root permission.

Now, Look if there are any docker images present in your system. Clean them all (Docker.raw). enter image description here

Using all these steps I was able to clean almost 100+ GB.

Solution 2:[2]

Recently found that this issue was caused by a memory leak in one of the Java applications I was running. I had to start the Activity Monitor, searching for Java processes and Force Quit them. Rinse and repeat every time my space runs out. Also fix your code where you can to get rid of memory leaks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vivek Garg
Solution 2 Patience Mpofu