Three preemptive waits track Windows DLL handling, and this page covers them together: PREEMPTIVE_OS_LOADLIBRARY (loading a DLL into the process), PREEMPTIVE_OS_FREELIBRARY (unloading one), and PREEMPTIVE_OS_LIBRARYOPS (the generic bucket for other library operations).
Their callers are the components that bring foreign code into the SQL Server process: extended stored procedure DLLs on first call, diagnostic and dump helpers, some provider and integration scenarios. PREEMPTIVE_OS_GETPROCADDRESS (covered on its own page) completes the picture by resolving entry points inside loaded DLLs.
Are They a Problem?
Rarely; loads are once-per-DLL events and the calls are quick from local disk. Slow loads have mundane causes worth checking when they occur: DLLs on network paths, antivirus scanning binaries on load, or signature verification stalling on revocation checks (see the crypto wait family). Frequent loads mean something keeps loading and unloading, XP DLLs configured to unload after each call being the classic.
Any presence is also a security-inventory nudge: DLLs loading into the engine’s address space should all be accounted for.
What To Do
- Inventory what loads: registered XPs, and anything else configured to bring DLLs in-process.
- Keep loaded binaries local and AV-excluded (the binaries, not the whole system).
- Reduce load churn by moving legacy XP functionality out of process where practical.
How To See It
Rank waits with Get-WaitStatistics; occurrences pair with XP usage and component initialisation events.
Part of the SQL Server Wait Types Library.
Related deep dive: SOS_SCHEDULER_YIELD Wait Type.
Leave a Reply