What is a ' library Cache:mutex X ' wait?
The mutex feature is a mechanism-to-control access to in memory structures. It is used in a number of areas including the library cache.
The library cache is a memory area, the holds parsed cursor structures needed to execute SQL.
Waits for ' library Cache:mutex X ' is similar to a library caches Waits in earlier versions. ' Library Cache:mutex X ' is caused by many issues (including application issues, lack of sharing resulting in high ver Sion counts etc.) But essentially something was holding the mutex for "too long", such that other session has to wait for the resource. If There is contention on the latches/mutexes that protect the library caches structures this means that there are stress on The parsing system. Parsing of SQL takes longer because it cannot get the resources they need. This delays other operations and generally slows the system.
Because of the varied causes, it is important to find the correct cause; So, the right solution can is implemented.
What causes ' library Cache:mutex X ' wait?
- Frequent hard parses-if The frequency of hard parsing are extremely high, then contention can occur on this pin.
- High version Counts-when version Counts become excessive, a long chain of versions needs to being examined and this can Lea D to contention on this event
- Invalidations-an invalidation is a measure of the number of times a cached cursor are deleted from the cache because it I s no longer valid. A cursor is invalidated because something have changed such that the copy of the cursor in memory are not valid any more. For example, regathering the statistics in an object or modifying a table definition was enough to invalidate a cursor for A query, which is based on the that object. When a cursor was invalidated, any sessions wanting to use the cursor need to wait for a valid version to be loaded. If there is excessive or unnecessary invalidation then significant waits for ' library Cache:mutex X ' can be seen.
- Reloads-reload is a count of the times a cursor this previously existed in the cache, were searched for, found To is there (because it had aged out etc) and then had to being re-compiled and re-loaded in to the library cache. High reloads is a bad thing because they indicate so you is doing work so you would not having had to do if your cache was setup appropriately so as is not to remove the cursor in the first place. If a cursor is being reloaded then it cannot being grabbed for work by a session and this can leads to waits for ' library Cach E:mutex X '.
- Known Bugs
Troubleshooting ' Library Cache:mutex X ' Waits.