• Not Answered

Sitecore dependency injection leak

Hi,

I'm getting a System.OutOfMemoryException: Array dimensions exceeded supported range. in Microsoft.Extensions.DependencyInjection.ServiceProvider.CaptureDisposable

Which appears to be where the DI tracks the transient services for disposal.

I've recently used the standard DI pipeline to register services and I only have 2 services (controllers) that implement IDisposable

Any ideas?

Thanks

Mat

1 Reply

  • Sitecore
    It looks like the ISitecoreServiceLocatorScope is resolved from the static serviceProvider, ISitecoreServiceLocatorScope is disposable so these references will build over time.

    As ServiceLocator.serviceProvider is a static field on a static class I believe the ISitecoreServiceLocatorScopes won't be disposed until the app pool is reset?