我正在使用第三方库,它使用C#DLL访问资源,而资源又使用内存映射到C ++运行时。第三方是SkypeKit,已不再开发。
出乎意料的是,我收到了一个例外(应用程序运行了好几天)"Shared Memory Key Overflow"
。堆栈跟踪不提供我的任何例程,以便我可以在发生的地方捕获它并动态修复它,并且我目前在应用程序代码中将其作为一个结束所有方法来捕获异常并优雅地恢复申请。
有什么方法可以解决这个内存问题,因为它是在我的代码之外引起的,或者是一种分析它的方法以找出它发生的原因?
干杯。
堆栈跟踪
6/12 / 2014-6:47:54 PM:DEBUG:Stack traceSystem.Exception:Shared 内存密钥溢出。内存不想共享。在 SkypeKit.SharedMemoryChannel.CreateMapping(UInt32 size)at SkypeKit.SktVideoRenderer.Start()上的SkypeKit.FrameTransport..ctor() 在SkypeKit.SktVideoRenderer.TimerTick(Object sender,EventArgs e)
在System.Windows.Threading.DispatcherTimer.FireTick(未使用的对象)
在System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate 回调,对象args,Int32 numArgs)at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象 source,Delegate方法,Object args,Int32 numArgs,Delegate catchHandler)at System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调, 对象args,Int32 numArgs,Delegate catchHandler)at System.Windows.Threading.DispatcherOperation.InvokeImpl()at System.Threading.ExecutionContext.runTryCode(Object userData)at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode 代码,CleanupCode backoutCode,Object userData)at System.Threading.ExecutionContext.Run(执行上下文 executionContext,ContextCallback回调,对象状态,布尔值 ignoreSyncCtx)at System.Threading.ExecutionContext.Run(执行上下文 executionContext,ContextCallback回调,对象状态)at System.Windows.Threading.DispatcherOperation.Invoke()at System.Windows.Threading.Dispatcher.ProcessQueue()at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean&处理) MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam, IntPtr lParam,Boolean&处理) MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)at System.Windows.Threading.ExceptionWrapper.InternalRealCall(代表 回调,对象args,Int32 numArgs)at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象 source,Delegate方法,Object args,Int32 numArgs,Delegate catchHandler)at System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调, 对象args,Int32 numArgs,Delegate catchHandler)at System.Windows.Threading.Dispatcher.InvokeImpl(的DispatcherPriority 优先级,TimeSpan超时,委托方法,对象args,Int32 在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,Int32)的numArgs) msg,IntPtr wParam,IntPtr lParam)at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)at at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame 框架)在System.Windows.Window.ShowHelper(Object booleanBox)at System.Windows.Window.ShowDialog()at A.c8b9966635edfd27b3cf3481492785b16.Configurator_Click(对象发送者, RoutedEventArgs e)at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args,Boolean reRaised)at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, System.Windows.Controls.Button.OnClick()的RoutedEventArgs args) 在 System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)在System.Windows.RoutedEventArgs.InvokeHandler(委托处理程序, 对象目标) System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args,Boolean reRaised)at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args,RoutedEvent newEvent)at System.Windows.RoutedEventArgs.InvokeHandler(委托处理程序,对象 目标)在System.Windows.EventRoute.InvokeHandlersImpl(Object source,RoutedEventArgs args,Boolean reRaised)at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)at at System.Windows.Input.InputManager.ProcessStagingArea()at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode模式,Int32时间戳,RawMouseActions操作,Int32 x, Int32 y,Int32 wheel)at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr的 hwnd,WindowMessage msg,IntPtr wParam,IntPtr lParam,Boolean& 处理) System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg,IntPtr wParam,IntPtr lParam,Boolean&处理) MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam, IntPtr lParam,Boolean&处理) MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)at System.Windows.Threading.ExceptionWrapper.InternalRealCall(代表 回调,对象args,Int32 numArgs)at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(对象 source,Delegate方法,Object args,Int32 numArgs,Delegate catchHandler)at System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调, 对象args,Int32 numArgs,Delegate catchHandler)at System.Windows.Threading.Dispatcher.InvokeImpl(的DispatcherPriority 优先级,TimeSpan超时,委托方法,对象args,Int32 在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,Int32)的numArgs) msg,IntPtr wParam,IntPtr lParam)at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)at at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame 框架)在System.Windows.Window.ShowHelper(Object booleanBox)at CallSite.Target中的System.Windows.Window.ShowDialog()(Closure, CallSite,Object)at System.Dynamic.UpdateDelegates.UpdateAndExecute1 [T0,TRET](调用点 site,T0 arg0)at(Object,CallSite,Object)at A.c7f72f7dfd341bf9a74e5c8753c372d7b.OnStartup(StartupEventArgs e)