AMPLibraryAgent and the Music app using over 100% of the CPU

I have a brand new 14” M1 Pro MacBook Pro running Monterey 12.5.1.  Since moving my music library over the first day I have been unable to use the Music app without the AMPLibraryAgent and the Music app using over 100% of the CPU and slowing down the whole computer-- and I cannot close the app without force-quitting.  My library is about 16,000 songs and I don't subscribe to Apple Music or iTunes Match. It's just me playing local music stored on my computer. I have done lots of googling and tried a bunch of suggestions, but I haven’t been able find a fix that works. It looks like there was a similar problem back with Catalina. Is anyone else having a similar problem? I would appreciate any suggestions on how to rectify the problem.




Posted on Aug 19, 2022 03:56 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 10, 2022 10:21 AM

(this is still orbit215, not sure why I'm showing up as alexearl3)


I wanted to report back in case someone out there with the same problem and stumbles upon this post.  


I spent many hours on the phone with Apple Customer Service trying to fix this issue and here are the things we tried:


1. Creating a new user and copying the music library under that new user profile and accessing there.  (Same problem.)


2. Creating a new music library under my login and importing the music files from the corrupt library into the new library.  This did solve the CPU problem and proved the issue was a corrupt Music Library, not an issue with the computer itself-- but I lost all my playlists.  I spent about 2 weeks slowly exporting individual playlists from the corrupt library and importing into the new library.  This seemed to work OK, but I have 20 years worth of hundreds and hundreds of playlists, so I had to pick and choose what to save. (These songs and playlists are part of my biorhythmic makeup at this point, so there was some soul searching over how much time I wanted to spend on this project-- and the answer was that it was worth it.)


But finally on my own, I figured out the true fix which turned out to be much easier and faster:


1. Before you start, make sure you have enough hard-disk space for 2 full copies of all your music files.  My corrupt library was 132 GIG, so I needed at least 132GIG more FREE before I started.


2. In the corrupt library, do File—> Library —> Export Library


3. Close the corrupt library


4. Option-Click when opening the Music app and chose “Create a new library” to create an empty library. 


5. Store the new library in your Music directory.  So you should have:


/Music/Music/Music Library (which is your old corrupt one)


/Music/MusicNew/Music Library (your new empty un-corrupt one)


6. In the new library, make sure Preferences —> Files has “Copy files to Music Media folder when adding to library” checked.


7. In the new library, do File —> Library —> Import Playlist and then choose the copy of the corrupt library you just exported from the corrupt library.  Yes, you are importing the LIBRARY as if it were a PLAYLIST, which was a major source of confusion, but this DID WORK.


8.  Make sure to wait for it to finish copy/importing/indexing and setting audio volume.  For my 18,000 songs this took about 2 hours.


That seemed to work! I have all my original playlists, the CPU usage has stayed low in Activity Monitor for about a week now and I haven’t discovered any music missing.  I can keep the corrupt copy for a while in case. So far so good and I appear to be back to normal.


[Personal Information Edited by Moderator]

Similar questions

2 replies
Question marked as Top-ranking reply

Sep 10, 2022 10:21 AM in response to orbit215

(this is still orbit215, not sure why I'm showing up as alexearl3)


I wanted to report back in case someone out there with the same problem and stumbles upon this post.  


I spent many hours on the phone with Apple Customer Service trying to fix this issue and here are the things we tried:


1. Creating a new user and copying the music library under that new user profile and accessing there.  (Same problem.)


2. Creating a new music library under my login and importing the music files from the corrupt library into the new library.  This did solve the CPU problem and proved the issue was a corrupt Music Library, not an issue with the computer itself-- but I lost all my playlists.  I spent about 2 weeks slowly exporting individual playlists from the corrupt library and importing into the new library.  This seemed to work OK, but I have 20 years worth of hundreds and hundreds of playlists, so I had to pick and choose what to save. (These songs and playlists are part of my biorhythmic makeup at this point, so there was some soul searching over how much time I wanted to spend on this project-- and the answer was that it was worth it.)


But finally on my own, I figured out the true fix which turned out to be much easier and faster:


1. Before you start, make sure you have enough hard-disk space for 2 full copies of all your music files.  My corrupt library was 132 GIG, so I needed at least 132GIG more FREE before I started.


2. In the corrupt library, do File—> Library —> Export Library


3. Close the corrupt library


4. Option-Click when opening the Music app and chose “Create a new library” to create an empty library. 


5. Store the new library in your Music directory.  So you should have:


/Music/Music/Music Library (which is your old corrupt one)


/Music/MusicNew/Music Library (your new empty un-corrupt one)


6. In the new library, make sure Preferences —> Files has “Copy files to Music Media folder when adding to library” checked.


7. In the new library, do File —> Library —> Import Playlist and then choose the copy of the corrupt library you just exported from the corrupt library.  Yes, you are importing the LIBRARY as if it were a PLAYLIST, which was a major source of confusion, but this DID WORK.


8.  Make sure to wait for it to finish copy/importing/indexing and setting audio volume.  For my 18,000 songs this took about 2 hours.


That seemed to work! I have all my original playlists, the CPU usage has stayed low in Activity Monitor for about a week now and I haven’t discovered any music missing.  I can keep the corrupt copy for a while in case. So far so good and I appear to be back to normal.


[Personal Information Edited by Moderator]

Aug 21, 2022 07:51 AM in response to orbit215

These are the things I've tried that didn't work:

  1. Letting it sit for days to finish indexing whatever needs indexing
  2. Moving library out of music directory, deleting iTunes & Music caches, rebooting, moving library back in
  3. Deleting AMPLibraryAgent caches & rebooting
  4. Tuning off “Keep Music Media folder organized” in Preferences, rebooting, turning that option back on.  This actually seemed to help the Music app use less CPU for that session, but AMPLibraryAgent was still running over 100% and “Saving Music Library” message would hang for hours upon exit.)
  5. File --> Library --> Organize library. I did have many (but not all) files in iTunes Media directory before, now everything is freshly organized into Music Media directory, but it didn’t fix the problem


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.

AMPLibraryAgent and the Music app using over 100% of the CPU

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