Killing MTLCompilerService memory leak process on Mac mini

For my always on Mac mini I created a one liner for killing the process, you may install it in root's crontab


Symptoms are usually obvious:



Mitigation

Mac-mini:~ root# ps x -m -o rss,pid,command | awk '/MTLCompilerService$/{if($1 > 99999) { print $2 } }' | xargs -n 1 kill -9


mem units in ps command equal to 1024 bytes, so you adjust the conditions. It is safe to kill the process as it has only a support function. You can use the same approach with e.g. Google Chrome



[Edited by Moderator]

Original Title: MTLCompilerService memory leak workaround


Mac mini, macOS 26.0

Posted on Oct 13, 2025 11:47 PM

Reply
7 replies

Oct 15, 2025 12:11 PM in response to Owl-53

Indeed it was another account, just realised that since you mentioned.


Meanwhile I have a process popped up out of nowhere that consumed a half of gigabyte in 2 hours while Mac was not even touched


Mac-mini:~ root# ps x -m -o rss,pid,command | grep MTL
598352 10026 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
 27200  2810 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
 18752  4965 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
  6272  4966 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService

Mac-mini:~ root# ps -o etime 10026
 ELAPSED
02:09:36
 
Mac-mini:~ root# lsof -p 10026
COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF                NODE NAME
MTLCompil 10026 root  cwd    DIR   1,17      704                   2 /
MTLCompil 10026 root  txt    REG   1,17   236352 1152921500312151359 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
MTLCompil 10026 root  txt    REG   1,17    26408 1152921500312151346 /System/Library/Frameworks/Metal.framework/Versions/A/Resources/MTLShaderLoggingRuntime.rtlib
MTLCompil 10026 root  txt    REG   1,17    72864             4184301 /Library/Preferences/Logging/.plist-cache.r2TPS1xF
MTLCompil 10026 root  txt    REG   1,17   238832 1152921500312290391 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.830/lib/darwin/libresource_tracking_rt_osx.rtlib
MTLCompil 10026 root  txt    REG   1,17   141896 1152921500312290375 /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.830/lib/darwin/libair_rt_osx.rtlib
MTLCompil 10026 root  txt    REG   1,17  2299264 1152921500312555984 /usr/lib/dyld
MTLCompil 10026 root  txt    REG   1,17  3483544 1152921500312151342 /System/Library/Frameworks/Metal.framework/Versions/A/Resources/MTLRaytracingRuntime.rtlib
MTLCompil 10026 root  txt    REG   1,17 34106928 1152921500312566381 /usr/share/icu/icudt76l.dat
MTLCompil 10026 root  txt    REG   1,17 14730288 1152921500312151531 /System/Library/Frameworks/MetalPerformancePrimitives.framework/Versions/A/Resources/libTensorOps.rtlib
MTLCompil 10026 root    0r   CHR    3,2      0t0                 336 /dev/null
MTLCompil 10026 root    1u   CHR    3,2      0t0                 336 /dev/null
MTLCompil 10026 root    2u   CHR    3,2      0t0                 336 /dev/null
Mac-mini:~ root# 

Oct 14, 2025 12:01 AM in response to stralex

Are you experiencing any symptoms, like your mac slowing down terribly, or any other indication of serious problems?


I am not convinced that there is an actual memory leak.


I just opened Activity Monitor and searched for MTL.


There are several MTLCompilerService processes, and they all appear to have the same 400+GB of virtual memory.

However, the memory pressure is green, and the Mac is performing perfectly. This seems more like either a glitch or the 415.9 GB is something like a potential limit, or something.


Oct 14, 2025 12:38 AM in response to Luis Sequeira1

Are you sure that your Mac runs macOS Tahoe?


Your screenshot looks like exactly what I had with previous version where processes never exceeded 100MB combined.


I trust Darwin kernel memory reporting and that is way to much sometimes:

ps x -m -o rss,pid,command | grep MTLCompilerService
2028032 17907 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
 31136  2490 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
 21408   819 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService
 19552 24658 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService

Oct 14, 2025 1:46 AM in response to stralex

I have to ask because I have seen another user who had a similar query


In their specific case which is much like yours " For my always on Mac mini "


They were complaining of Excessive Memory Leak in "  MTLCompilerService "


They reported this was occurring when running also Google Chrome all the time


Unlike my colleague.


This M4 Mac Mini is running Tahoe 26.0.1 and no, it is not running all the time nor does it run the Memory Hog >> Google Chrome <<




This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Killing MTLCompilerService memory leak process on Mac mini

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.