Objective
-
Recently found that many Mac users reflect their Mac system display memory consumption up to more than 200 Gb, but actually download the application is not so much, the use of professional memory scanning tools to scan the results of the system itself is completely different. So what is the reason for this problem, the following will give you a detailed introduction of the reasons for the occurrence of this situation and how to solve.
- This is the Mac comes with the system Information.app (about this Mac).
1. Mechanism
-
When we click on the Save button, the MAC background will be spotlight to audio,movie,apps these attributes of the file statistics.
-
Behind the spotlight is indexed by a set of metadata mechanisms of the MAC, metadata can be understood as a quick classification and meta-Data index for the entire filesystem, like a dictionary directory, where you can feel the metadata stored in the root directory.
-
The MAC has a specification for the entire metadata, which can be viewed through commands Mdls, Attributes Kmditemcontenttypetree, incrementing properties.
-
So the size of the statistics Apps is to summarize all the "com.apple.package".
2. Solution
-
In some cases, the metadata index may be wrong, at this time, we see the results of the statistics will be a problem or too much deviation, this time, you can use the following steps
-
Make sure the spotlight is not closed.
-
Show enabled to enter the second step, or you need to open the spotlight
$ alexs-iMac:Documents alex$ sudo mdutil -i on /
-
Metadata re-index the entire disk of the MAC
$ sudo mdutil -E /
-
This step of the operation compared to the consumption of disk IO, the obvious feeling is that the system is not so smooth, if the disk is large, more files, it may take a long time. It is best to operate at work or in a meal.
3. Rebuilding Spotlight Index
-
Spotlight index in MAC System (upper right corner of the screen) the function believes that we must often use, although Spotlight in the disk Content Update index is also very timely, but there will be some cases, we need to re-establish a Spotlight index, such as the newly restored disk, Or, in some cases, to rebuild the index, this time we need to manually rebuild the Spotlight index.
-
Here's how to rebuild the Spotlight index using terminal commands
$ sudo mdutil -E /
-
The above command can re-index all the disks under the Mac, including the Mac's own hard disk, disk mirroring, and external hard drives.
$ sudo mdutil -E /Volumes/Macintosh\ HD/
-
The above command can only choose to rebuild the Mac Primary disk index of Macintosh HD
$ sudo mdutil -E /Volumes/External/
-
The above command can reconstruct an external disk's index content, of course, to consider replacing the name of the external disk, where the name is "External"
-
In fact, you can also choose to rebuild the index of a file, or a folder directory can also, first we need to the path of the file or folder directory, and then replaced by the following command:
$ mdimport /path/to/file
-
Of course, if you don't like to use the terminal, there is a little trick to do with the Spotlight Control Panel:
-
Open Spotlight in System Preferences, then click on the "Privacy" tab to find the Prevent search, drag the disk or directory you want to retrieve again
-
Drag and drop in and select, click on the "minus" symbol below to remove the prevention of the content, you can rebuild the index
Ios-mac Rebuilding Spotlight Index