Skip to content

Cache - Array dimensions exceeded supported range #69

@Jonsapps

Description

@Jonsapps

We have a project that uses MSharp originally created by Geeks Ltd. We have found that in recent months our production site is crashing periodically due to the size of the MSharp Database Cache exceeding the array dimensions set by C#.

I have recently upgraded MSharp to the latest version in the hope this would resolve the issue, unfortunately the issue remains. At present the only way we are able to resolve the issue is to restart IIS. This seemingly clears the cache and starts fresh, then in a few days the same will happen again. I cannot find any specific information regarding the cache in the documentation or any hints on how we can control what caches and what doesn't, it seems every database object is cached and as the project and database grow we are hitting the array limits of the cache sooner and sooner.

Can you clarify if this is expected behaviour and whether there are mechanisms available in the framework to allow us to control which database objects are cached.

MSharp Version: 4.0.201

Stack Trace from a crash when the cache exceeds the arrays dimensions:

Error: Array dimensions exceeded supported range.

STACK TRACE:

at System.MulticastDelegate.CombineImpl(Delegate follow)

  at MSharp.Framework.Database.add_CacheRefreshed(EventHandler value)

  at Domain.Role.get_DeptAdmin() in D:\a\1\s\Source\Domain\Entities\Role.cs:line 195

  at Domain.StaffMember.CanManageDepartments() in D:\a\1\s\Source\Domain\-Logic\Users\StaffMember.Permission.cs:line 361

  at Controllers.SiteController.Index(SelectDepartment info) in D:\a\1\s\Source\Website\Controllers\Pages\SiteController.cs:line 44

  at lambda_method(Closure , ControllerBase , Object[] )

  at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)

  at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)

  at System.Web.Mvc.Async.AsyncControllerActionInvoker. b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)

  at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters. b__3d()

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters. c__DisplayClass46. b__3f()

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters. c__DisplayClass46. b__3f()

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters. c__DisplayClass46. b__3f()

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)

  at System.Web.Mvc.Async.AsyncControllerActionInvoker. c__DisplayClass21. c__DisplayClass2b. b__1c()

  at System.Web.Mvc.Async.AsyncControllerActionInvoker. c__DisplayClass21. b__1e(IAsyncResult asyncResult)

  at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)

  at System.Web.Mvc.Controller. b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)

  at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)

  at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)

  at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)

  at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)

  at System.Web.Mvc.MvcHandler. b__5(IAsyncResult asyncResult, ProcessRequestState innerState)

  at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)

  at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)

  at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

  at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)

  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions