none
COMException - This command is not enough memory available.

    Question

  • Hi Everyone,

    I have developed a WPF application with HockeyApp (third party tool - to track silent crashes). I am getting lots of crashes nearly sixty thousand crashes logged as COM exception.

    Frankly, I don't have any knowledge about this and to solve this issue. So can you guys please guide me resolve this issue.

    Please see the stacktrace as below;

    System.Runtime.InteropServices.COMException: This command is not enough memory available. (Exception from HRESULT: 0x80070008)
       bei MS.Internal.TextFormatting.TextMetrics.FullTextLine.FormatLine(FullTextState fullText, Int32 cpFirst, Int32 lineLength, Int32 formatWidth, Int32 finiteFormatWidth, Int32 paragraphWidth, LineFlags lineFlags, FormattedTextSymbols collapsingSymbol)
       at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal (Text Source text Source, Int32 firstCharIndex, Int32 lineLength, Double width paragraph, TextParagraphProperties paragraphProperties, text LineBreak previousLineBreak, TextRunCache textRunCache)
       at MS.Internal.TextFormatting.TextFormatterImp.FormatLine (Text Source text Source, Int32 firstCharIndex, Double width paragraph, TextParagraphProperties paragraphProperties, text LineBreak previousLineBreak, TextRunCache textRunCache)
       bei MS.Internal.Text.Line.Format(Int32 dcp, Double width, TextParagraphProperties lineProperties, TextLineBreak textLineBreak, TextRunCache textRunCache, Boolean showParagraphEllipsis)
       bei System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Control.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.StackPanel.StackMeasureHelper(IStackMeasure measureElement, IStackMeasureScrollData scrollData, Size constraint)
       bei System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Control.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.Window.MeasureOverrideHelper(Size constraint)
       bei System.Windows.Window.MeasureOverride(Size availableSize)
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.ContextLayoutManager.UpdateLayout()
       bei System.Windows.UIElement.UpdateLayout()
       bei System.Windows.Controls.VirtualizingStackPanel.<>c__DisplayClass94_0.<InitializeViewport>b__0()
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    Caused by: System.Runtime.InteropServices.COMException: This command is not enough memory available. (Exception from HRESULT: 0x80070008)
       bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
       bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
       bei MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)
       bei MS.Internal.Text.TextInterface.Font.CreateFontFace()
       bei MS.Internal.Text.TextInterface.Font.AddFontFaceToCache()
       bei MS.Internal.Text.TextInterface.Font.GetFontFace()
       bei System.Windows.Media.GlyphTypeface..ctor(Font font)
       bei MS.Internal.FontFace.PhysicalFontFamily.MapGlyphTypeface (Font Style style, Font Weight Weight, Font Stretch stretch, Character Buffer Range charString, CultureInfo digitCulture, Int32 & Advance, Int32 & nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapByFontFaceFamily(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, IFontFamily fontFamily, FontStyle canonicalStyle, FontWeight canonicalWeight, FontStretch canonicalStretch, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Boolean nullFont, Double scaleInEm, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Boolean ignoreMissing, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapByFontFamily(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, IFontFamily fontFamily, CanonicalFontFamilyReference canonicalFamilyReference, FontStyle canonicalStyle, FontWeight canonicalWeight, FontStretch canonicalStretch, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 recursionDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapOnceByFontFamilyList(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, FontFamily[] familyList, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 recursionDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapByFontFamilyList(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, FontFamily[] familyList, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 recursionDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapByFontFamilyName(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, String familyName, Uri baseUri, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 fontMappingDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapByFontFamily(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, IFontFamily fontFamily, CanonicalFontFamilyReference canonicalFamilyReference, FontStyle canonicalStyle, FontWeight canonicalWeight, FontStretch canonicalStretch, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 recursionDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapOnceByFontFamilyList(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, FontFamily[] familyList, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 recursionDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapByFontFamilyList(CharacterBufferRange unicodeString, CultureInfo culture, CultureInfo digitCulture, FontFamily[] familyList, PhysicalFontFamily& firstValidFamily, Int32& firstValidLength, IDeviceFont deviceFont, Double scaleInEm, Int32 recursionDepth, SpanVector scaledTypefaceSpans, Int32 firstCharIndex, Int32& nextValid)
       bei MS.Internal.Shaping.TypefaceMap.MapItem(CharacterBufferRange unicodeString, CultureInfo culture, Span itemSpan, SpanVector`1& cachedScaledTypefaceIndexSpans, Int32 ichItem)
       bei MS.Internal.Shaping.TypefaceMap.GetShapeableText(CharacterBufferReference characterBufferReference, Int32 stringLength, TextRunProperties textRunProperties, CultureInfo digitCulture, Boolean isRightToLeftParagraph, IList`1 shapeableList, IShapeableTextCollector collector, TextFormattingMode textFormattingMode)
       bei MS.Internal.Shaping.GlyphingCache.GetShapeableText(Typeface typeface, CharacterBufferReference characterBufferReference, Int32 stringLength, TextRunProperties textRunProperties, CultureInfo digitCulture, Boolean isRightToLeftParagraph, IList`1 shapeableList, IShapeableTextCollector collector, TextFormattingMode textFormattingMode)
       at glyphingCache, Character Buffer Reference character reference buffer, Int32 length, Boolean rightToLeft, Boolean isRightToLeftParagraph, CultureInfo digit culture, TextModifierScope textModifierScope, Text Formatting Text Formatting Mode mode, Boolean isSideways)
       bei MS.Internal.TextFormatting.TextStore.CreateTextLSRuns(TextRunInfo runInfo, IList`1 textEffects, CultureInfo digitCulture, Int32 offsetToFirstChar, Int32 stringLength, Int32 uniformBidiLevel, TextFormattingMode textFormattingMode, Boolean isSideways, Int32& lastBidiLevel)
       bei MS.Internal.TextFormatting.TextStore.CreateLSRuns(TextRunInfo runInfo, IList`1 textEffects, CultureInfo digitCulture, Int32 offsetToFirstChar, Int32 stringLength, Int32 uniformBidiLevel, TextFormattingMode textFormattingMode, Boolean isSideways, Int32& lastBidiLevel, Int32& textRunLength)
       bei MS.Internal.TextFormatting.TextStore.CreateLSRunsUniformBidiLevel (SpanVector runInfoVector, SpanVector textEffectsVector, Int32 runInfoFirstCp, Int32 ichUniform, Int32 cchUniform, Int32 uniformBidiLevel, Text Formatting Mode text formatting mode, Boolean isSideways, Int32 & lastBidiLevel)
       at MS.Internal.TextFormatting.TextStore.FetchLSRun (Int32 lscpFetch, Text Formatting Text Formatting Mode mode, Boolean isSideways, Plsrun & plsrun, Int32 & lsrunOffset, Int32 & lsrunLength)
       (pols IntPtr, Int32 lscpFetch, Int32 fIsStyle, IntPtr pstyle, char * pwchTextBuffer, Int32 cchTextBuffer, Int32 & fIsBufferUsed, char * & pwchText, Int32 & cchText, Int32 & fIsHidden, LsChp & lschp, IntPtr & lsplsrun) at MS.Internal.TextFormatting.LineServicesCallbacks.FetchRunRedefined

    Wednesday, January 20, 2016 3:55 PM

All replies

  • Hi Shahid Huss,

    TextInterface might lead to memory leak. The WPF team has reviewed this issue and fixed in .NET 4.6. You could upgrade your .net framework up to 4.6 and try again. Similar question below is for your reference.

    Exception with TextInterface

    Best Regards,

    Xavier Eoro


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Friday, January 22, 2016 5:26 AM
    Moderator
  • Hi Xavier,

    Thanks for your time.

    So can you please tell me how to upgrade .net framework 4.5 to 4.6 ? Will it available through latest windows OS release or windows update ? 

    Thanks,
    Shahid Huss.

    Friday, January 22, 2016 2:59 PM
  • Hi Xavier,

    Thanks for your time.

    So can you please tell me how to upgrade .net framework 4.5 to 4.6 ? Will it available through latest windows OS release or windows update ? 

    Thanks,
    Shahid Huss.

    Hi Shahid Huss,

    >>”So can you please tell me how to upgrade .net framework 4.5 to 4.6 ?”

    To download the .NET Framework, you could see the MSDN document about “Installing the .NET Framework Guide” for details:

    https://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx

    After that you could switch the “Target version” of your project property to see if you would meet the issue.

    By the way, because this is WPF forum, it only supports WPF issue, if you want to know more information about ".NET Framework setup or upgrade". You'd better post a new thread in ".NET Framework Setup and Servicing forum", you would get better support.

    Here's the link: https://social.msdn.microsoft.com/Forums/en-US/home?forum=netfxsetup

    Best Regards,

    Xavier Eoro


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Saturday, January 23, 2016 7:55 AM
    Moderator
  • Excuse me, I have the same question, can you help me?

    Thanks。

    https://social.msdn.microsoft.com/Forums/en-US/45c6f858-b9d8-4768-bcd9-468d01e7f911/comexception-this-command-is-not-enough-memory-available?forum=wpf

    Saturday, February 4, 2017 8:36 AM
  • Hi Xavier,

    We are also having the same issue, but it is not possible for us to change the .Net Framework version for time being, instead is there any hot-fixes or patch available for .Net 4.5.2

    Thanks and Regards

    Amal VR

    Thursday, October 19, 2017 12:11 PM