PDA

View Full Version : [FIX] High cpu usage from Finder/QTKitServer when you open a folder with mkv files




phobox
Oct 6, 2012, 11:38 PM
Hi all

As some of you may have noticed, if you have installed Perian and have a folder full of mkv files, Finder and QTKitServer will go a bit crazy when you open this folder. This is because they are trying to create thumbnail images for the movies automatically and most of the time fail on mkv files or broken avi files, thus causing the high cpu/disk thrashing (often even after you've closed the folder).

There is a fix for this, but I must warn you not to do any of this if you arent comfortable modifying system files. I have tested it on my own system with good results however.

OSX has a sandbox layer in which almost all processes run, including system processes. This sandbox has rules and by modifying those rules, we can change how things work. In this case we are changing the rules so that QTKitServer will not be able to touch mkv files. Note that this may also have the side effect of you not being able to open mkv files in QuickTime anymore, in which case just use VLC or some other movie player instead.

If you are ready to proceed, do the following:

Open Terminal, type:

sudo nano /System/Library/Sandbox/Profiles/com.apple.qtkitserver.sb

This will open the nano editor with the rules file. Scroll right to the bottom of this file and enter:

(deny file-read* (regex #"^.*\.mkv$"))

After this do Ctrl-O and then Ctrl-X to save and exit the application.

The effect will be immediate and you should have no more issue with thumbnail generation going crazy in a folder with mkv's. It will not affect any other video or audio files.

Again if you arent comfortable in terminal or with modifying system files, I would suggest not doing this yourself. For everybody else, I hope this helps :)



gumblecosby
Oct 10, 2012, 09:49 PM
Absolutely brilliant. This fixed the problem immediately. I can see sandbox daemon run in Activity Monitor for a second and stop now when I open a folder with an MKV file so it works perfectly. Thank you.

Where did you discover the appropriate documentation on Sandbox profiles?

Edit:
FLV files were causing problems too. I entered this to fix it:

(deny file-read* (regex #"^.*\.flv$"))

mactoday
Nov 29, 2012, 04:45 AM
Hi all

As some of you may have noticed, if you have installed Perian and have a folder full of mkv files, Finder and QTKitServer will go a bit crazy when you open this folder. This is because they are trying to create thumbnail images for the movies automatically and most of the time fail on mkv files or broken avi files, thus causing the high cpu/disk thrashing (often even after you've closed the folder).

There is a fix for this, but I must warn you not to do any of this if you arent comfortable modifying system files. I have tested it on my own system with good results however.

OSX has a sandbox layer in which almost all processes run, including system processes. This sandbox has rules and by modifying those rules, we can change how things work. In this case we are changing the rules so that QTKitServer will not be able to touch mkv files. Note that this may also have the side effect of you not being able to open mkv files in QuickTime anymore, in which case just use VLC or some other movie player instead.

If you are ready to proceed, do the following:

Open Terminal, type:

sudo nano /System/Library/Sandbox/Profiles/com.apple.qtkitserver.sb

This will open the nano editor with the rules file. Scroll right to the bottom of this file and enter:

(deny file-read* (regex #"^.*\.mkv$"))

After this do Ctrl-O and then Ctrl-X to save and exit the application.

The effect will be immediate and you should have no more issue with thumbnail generation going crazy in a folder with mkv's. It will not affect any other video or audio files.

Again if you arent comfortable in terminal or with modifying system files, I would suggest not doing this yourself. For everybody else, I hope this helps :)

Cool, I have done the same for avi and finally I could breath :) Thanks, dude!
but in general Apple is sucks with this preview.

yto
Dec 3, 2012, 02:02 AM
it didn't work for me 10.8.2 Did everything by this manual.
https://www.dropbox.com/s/82lm7hdwz470m53/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202012-12-03%20%D0%B2%2018.04.26.png
What is wrong ?

mactoday
Mar 25, 2013, 10:56 AM
Hi all

As some of you may have noticed, if you have installed Perian and have a folder full of mkv files, Finder and QTKitServer will go a bit crazy when you open this folder. This is because they are trying to create thumbnail images for the movies automatically and most of the time fail on mkv files or broken avi files, thus causing the high cpu/disk thrashing (often even after you've closed the folder).

There is a fix for this, but I must warn you not to do any of this if you arent comfortable modifying system files. I have tested it on my own system with good results however.

OSX has a sandbox layer in which almost all processes run, including system processes. This sandbox has rules and by modifying those rules, we can change how things work. In this case we are changing the rules so that QTKitServer will not be able to touch mkv files. Note that this may also have the side effect of you not being able to open mkv files in QuickTime anymore, in which case just use VLC or some other movie player instead.

If you are ready to proceed, do the following:

Open Terminal, type:

sudo nano /System/Library/Sandbox/Profiles/com.apple.qtkitserver.sb

This will open the nano editor with the rules file. Scroll right to the bottom of this file and enter:

(deny file-read* (regex #"^.*\.mkv$"))

After this do Ctrl-O and then Ctrl-X to save and exit the application.

The effect will be immediate and you should have no more issue with thumbnail generation going crazy in a folder with mkv's. It will not affect any other video or audio files.

Again if you arent comfortable in terminal or with modifying system files, I would suggest not doing this yourself. For everybody else, I hope this helps :)
I've done everything that you wrote but this solution didn't help. I run 10.7.5 with all last updates.
How to permanently disable this QTKitServer QuickLook Helper? Looks like folks in Apple don't see a huge problem because they reported that it's not a bug that mine CPU overloaded by their ****** software. Jobs was **** allover Flash but their own software overload CPU over 100%. I suppose folks in Apple feels like everyone only should use their mp4 with h.264.

svkrzn
Jul 3, 2013, 01:51 PM
If you are ready to proceed, do the following:

Open Terminal, type:

sudo nano /System/Library/Sandbox/Profiles/com.apple.qtkitserver.sb

This will open the nano editor with the rules file. Scroll right to the bottom of this file and enter:

(deny file-read* (regex #"^.*\.mkv$"))

After this do Ctrl-O and then Ctrl-X to save and exit the application.

The effect will be immediate and you should have no more issue with thumbnail generation going crazy in a folder with mkv's. It will not affect any other video or audio files.

Again if you arent comfortable in terminal or with modifying system files, I would suggest not doing this yourself. For everybody else, I hope this helps :)

Nice tip, but from time to time seems that the file itself resets and the rows i add
(deny file-read* (regex #"^.*\.mkv$"))
(deny file-read* (regex #"^.*\.avi$"))

Can it be set as read only?

svkrzn
Jul 23, 2013, 01:51 PM
Anyone pleasE?