{"record":{"id":"79fa2dc14f5f078d","repo":"dotnet/wpf","slug":"fontcachefullexception","errorCode":null,"errorMessage":"FontCacheFullException","messagePattern":"FontCacheFullException","errorType":"exception","errorClass":"FontCacheFullException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/FontCache/FontCacheLogic.cs","lineNumber":415,"sourceCode":"        /// </summary>\n        /// <param name=\"size\"></param>\n        /// <returns></returns>\n        internal int Alloc(int size)\n        {\n            Invariant.Assert(size >= 0);\n\n            // If the requested size is zero, we can return any offset within the file.\n            if (size == 0)\n                return 0;\n\n            lock(_cacheLock)\n            {\n                int oldSize = CurrentSize;\n                Util.AssertAligned8(oldSize);\n                int newSize = Util.Align8(oldSize + size);\n                Invariant.Assert(newSize > oldSize);\n                if (newSize > MaxCacheSize)\n                    throw new FontCacheFullException();\n\n\n                //commit the memory for the new data\n                _mfile.Commit(newSize);\n\n                //Now, update the size entry in the cache header\n                GetCacheHeader()->CurSize = newSize;\n\n                Thread.MemoryBarrier();\n                return oldSize;\n            }\n        }\n\n        /// <summary>\n        /// IFontCacheElement lookup\n        /// </summary>\n        /// <param name=\"e\"></param>\n        /// Adds the element if it doesn't exist in the cache.","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/FontCache/FontCacheLogic.cs#L397-L433","documentation":"FontCacheFullException thrown from FontCacheLogic.Alloc when an allocation request would grow the shared font cache mapping past its fixed capacity — i.e. the aligned new size exceeds the maximum cache size, so there is no room for the requested entry.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/FontCache/FontCacheLogic.cs:415 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the font cache size (cache size registry/machine.config setting) so working sets fit","Reduce the number of installed fonts or font families that must be cached","Evict the cache (restart the WPF font cache service) so stale entries are released and retry the allocation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}