none
Failed to allocate a managed memory buffer of 67108864 bytes. The amount of available memory may be low. RRS feed

  • Question

  • I have a problem i am using the following configuration at production machine this configuration give me this error.

    "Failed to allocate a managed memory buffer of 67108864 bytes. The amount of available memory may be low."

    but when i restore same database on my development machine and run the service with same configuration it works fine.

    Binding Client Side

    <bindings>
          <wsHttpBinding>
            <binding name="ExtendedwsHttpBinding" maxReceivedMessageSize="2147483647" sendTimeout="23:59:59" textEncoding="utf-16">
              <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"   />
              <security>
                <message establishSecurityContext="false"  />
              </security>
            </binding>
          </wsHttpBinding>
    </bindings>

    Binding Server Side:

    <bindings>
          <wsHttpBinding>
            <binding name="ExtendedConfiguration" maxReceivedMessageSize="2147483647">
              <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
              <security>
                <message establishSecurityContext="false" />
              </security>
            </binding>
        </bindings>

    behaviour server side:

    <behaviors>
          <serviceBehaviors>
            <behavior name="returnFaults">
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceMetadata httpGetEnabled="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
    
        </behaviors>

    but on production server it gives the error

    The underlying connection was closed: The connection was closed unexpectedly."

    and when i run the trace for WCF service i found out

    "Failed to allocate a managed memory buffer of 67108864 bytes. The amount of available memory may be low."

    can any one tell me how can i solve this problem

    Regards,

    ADL



    • Edited by MDADLSD Wednesday, August 6, 2014 11:57 AM
    Wednesday, August 6, 2014 11:54 AM

Answers

  • Hi,

    >>"Failed to allocate a managed memory buffer of 67108864 bytes. The amount of available memory may be low."

    In order to avoid this error, please try to set transferMode attribute to "Streamed" rather than "Buffered" (default value) in the both client and server side as following:

    <bindings>
          <wsHttpBinding>
            <binding name="ExtendedwsHttpBinding" maxReceivedMessageSize="2147483647"
    transferMode="Streamed"
    ........../>
    </basicHttpBinding>

    Because in the default buffered-transfer mode, a message must be completely delivered before a receiver can read it. In the Streamed transfer mode, the receiver can begin to process the message before it is completely delivered. The Streamed mode is useful when the information that is passed is lengthy and can be processed serially. Streaming mode is also useful when the message is too large to be entirely buffered.

    For more information, please try to refer to the following article:
    http://msdn.microsoft.com/en-us/library/ms789010.aspx .

    Best Regards,
    Amy Peng


    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.




    Thursday, August 7, 2014 9:30 AM
    Moderator

All replies

  • Hi,

    >>"Failed to allocate a managed memory buffer of 67108864 bytes. The amount of available memory may be low."

    In order to avoid this error, please try to set transferMode attribute to "Streamed" rather than "Buffered" (default value) in the both client and server side as following:

    <bindings>
          <wsHttpBinding>
            <binding name="ExtendedwsHttpBinding" maxReceivedMessageSize="2147483647"
    transferMode="Streamed"
    ........../>
    </basicHttpBinding>

    Because in the default buffered-transfer mode, a message must be completely delivered before a receiver can read it. In the Streamed transfer mode, the receiver can begin to process the message before it is completely delivered. The Streamed mode is useful when the information that is passed is lengthy and can be processed serially. Streaming mode is also useful when the message is too large to be entirely buffered.

    For more information, please try to refer to the following article:
    http://msdn.microsoft.com/en-us/library/ms789010.aspx .

    Best Regards,
    Amy Peng


    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.




    Thursday, August 7, 2014 9:30 AM
    Moderator
  • ok i will try this one more question even production database is less than 15 gb but in error message it is showing 67108864bytes-64GB why it is like that
    Thursday, August 7, 2014 10:38 AM
  • Because you use the buffer method with all data in the memery, then it will be 64GB.
    Thursday, August 14, 2014 10:16 AM