Приветствую.
Имею такую проблему сейчас. Есть сервер с 12 гб оперативной памяти, работающий под управлением ОС widows Server 2003 R2 64 бит. Запускаю оптимизацию, через некоторое время вылетает, вот кусок лога:
Click to reveal..

18:36:54.93[1]ERROR:Main():
System.OutOfMemoryException: Выдано исключение типа "System.OutOfMemoryException".
в System.Windows.Controls.TextBlock.GetLineProperties()
в System.Windows.Controls.TextBlock.GetLineProperties(Boolean firstLine, Boolean showParagraphEllipsis, LineProperties lineProperties)
в System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
в System.Windows.FrameworkElement.MeasureCore(Size availableSize)
в System.Windows.UIElement.Measure(Size availableSize)
в System.Windows.ContextLayoutManager.UpdateLayout()
в System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
в System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
в System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
в System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
в System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
18:36:55.57[26]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.OrderedEnumerable`1.GetEnumerator()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:55.57[26]INFO :120:Error:Script::System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.OrderedEnumerable`1.GetEnumerator()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:55.57[26]INFO :System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.OrderedEnumerable`1.GetEnumerator()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:55.90[23]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.OrderByDescending[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:55.90[23]INFO :120:Error:Script::System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.OrderByDescending[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:55.90[23]INFO :System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.OrderByDescending[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:56.53[30]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.ScriptEngine.PositionsList.MakePosition(String signalName, Boolean isLong, Int32 bar, Double price, Double shares, OrderType orderType, Boolean fixPrice)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:56.53[30]INFO :120:Error:Script::System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.ScriptEngine.PositionsList.MakePosition(String signalName, Boolean isLong, Int32 bar, Double price, Double shares, OrderType orderType, Boolean fixPrice)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:56.53[30]INFO :System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.ScriptEngine.PositionsList.MakePosition(String signalName, Boolean isLong, Int32 bar, Double price, Double shares, OrderType orderType, Boolean fixPrice)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:56.89[30]ERROR:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.DataModel.Settings.GrouppedSettings.Get[T]()
at TSLab.DataModel.AppSettingsManager.Get[T]()
at TSLab.LabView.Script.ScriptDataManager.State.LockCalculation()
at TSLab.LabView.Script.ScriptDataManager.State.Dispose()
at TSLab.ScriptEngine.Optimization.ExecuteOneStep()
18:36:57.56[24]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:57.56[5]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.List`1.set_Capacity(Int32 value)
at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
at System.Collections.Generic.List`1.Add(T item)
at TSLab.ScriptEngine.PositionsList.Add(Position item)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:57.56[24]INFO :120:Error:Script::System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:57.56[24]INFO :System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:57.56[5]INFO :120:Error:Script::System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.List`1.set_Capacity(Int32 value)
at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
at System.Collections.Generic.List`1.Add(T item)
at TSLab.ScriptEngine.PositionsList.Add(Position item)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:57.56[5]INFO :System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Collections.Generic.List`1.set_Capacity(Int32 value)
at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
at System.Collections.Generic.List`1.Add(T item)
at TSLab.ScriptEngine.PositionsList.Add(Position item)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:58.62[17]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.OrderByDescending[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:58.62[17]INFO :120:Error:Script::System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.OrderByDescending[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:58.62[17]INFO :System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.Enumerable.OrderByDescending[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:36:59.00[1]ERROR:Main():
System.OutOfMemoryException: Выдано исключение типа "System.OutOfMemoryException".
в System.Threading.SynchronizationContext.SetWaitNotificationRequired()
в System.Windows.Threading.DispatcherSynchronizationContext..ctor(Dispatcher dispatcher)
в System.Windows.Threading.DispatcherOperation.InvokeImpl()
в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
в System.Threading.ExecutionContext.runTryCode(Object userData)
в System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
в System.Windows.Threading.DispatcherOperation.Invoke()
в System.Windows.Threading.Dispatcher.ProcessQueue()
в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
18:36:59.92[22]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.ScriptEngine.PositionsList.MakePosition(String signalName, Boolean isLong, Int32 bar, Double price, Double shares, OrderType orderType, Boolean fixPrice)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:37:14.00[5]DEBUG:<log4net.Error>Exception rendering object type [System.OutOfMemoryException]<stackTrace></stackTrace></log4net.Error>
18:37:14.96[31]ERROR:Main():
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Threading.ExecutionContext.CreateCopy()
at System.Threading._TimerCallback.PerformTimerCallback(Object state)
18:37:14.96[25]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.ScriptEngine.PositionsList.MakePosition(String signalName, Boolean isLong, Int32 bar, Double price, Double shares, OrderType orderType, Boolean fixPrice)
at TSLab.ScriptEngine.PositionsList.BuyAtMarket(Int32 barNum, Double shares, String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:37:16.59[14]ERROR:Main():
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Threading.ExecutionContext.CreateCopy()
at System.Threading._TimerCallback.PerformTimerCallback(Object state)
18:37:17.59[17]DEBUG:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at TSLab.ScriptEngine.PositionsList.<.ctor>b__6(String signalName)
at TSLab.ScriptEngine.PositionsList.ByNameCache.Get(String signalName)
at TSLab.ScriptEngine.PositionsList.GetLastActiveForSignal(String signalName)
at TSLab.User.Script.Execute(IContext context, ISecurity Source1)
18:37:19.50[1]ERROR:Main():
<log4net.Error>Exception rendering object type [System.OutOfMemoryException]<stackTrace></stackTrace></log4net.Error>
18:37:19.53[26]ERROR:System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
at TSLab.ScriptEngine.OptimizationResult..ctor(IRuntime2 runtime, IEnumerable`1 props)
at TSLab.ScriptEngine.Optimization.ExecuteOneStep()
18:37:23.65[28]ERROR:Main():
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Threading.ExecutionContext.CreateCopy()
at System.Threading._TimerCallback.PerformTimerCallback(Object state)
18:37:24.00[24]DEBUG:18:37:28.40[12]ERROR:Main():
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Threading.ExecutionContext.CreateCopy()
at System.Threading._TimerCallback.PerformTimerCallback(Object state)

На этом процесс вылетел. Во время работы вел мониторинг производительности системы, из 12гб доступной оперативной памяти использовалось 1.5гб.
Подскажите пожалуйста как бороться с проблемой.
Заранее благодарю.


Отредактировано ViL (Thu Apr 28 2011 12:14 AM)