Free memory (14618624 bytes) is less than 5% of total memory in WCF

by Raju Maharjan 18. June 2011 14:38

 

If you ever received the below error while accessing your WCF servcie, then it is most likely that your server is having very low free memory. In this case, one of the main reason could be some big application running on the server consuming most of the memory.

So best way to get rid of this problem could be increase the memory for your server. In the other hand, you may uninstall the undesired applications running at your server.

 

Server Error in 'yourdomain/app' Application.


Memory gates checking failed because the free memory (14618624 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InsufficientMemoryException: Memory gates checking failed because the free memory (14618624 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[InsufficientMemoryException: Memory gates checking failed because the free memory (14618624 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.]
System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage) +51455
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +604

[ServiceActivationException: The service '/staging/coresecurityservice/coresecurityservice.svc' cannot be activated due to an exception during compilation. The exception message is: Memory gates checking failed because the free memory (14618624 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element..]
System.Runtime.AsyncResult.End(IAsyncResult result) +679246
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar) +300622
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +8837348

 

You can also update your wcf configuration files for the required parameters and also set minFreeMemoryPercentageToActivateService  in ServiceHostingEnvironment

<serviceHostingEnvironment>
         aspNetCompatibilityEnabled="Boolean"
       minFreeMemoryPercentageToActivateService="Integer"
     <baseAddressPrefixFilters>
                <add prefix="string"/>
          </baseAddressPrefixFilters>
     <transportConfigurationTypes>
        <add name="String" 
             transportConfigurationType="String" />
     </transportConfigurationTypes>
</serviceHostingEnvironment>

 

Set the minimum free memory percentage according to your  needs:

 

minFreeMemoryPercentageToActivateService="1" //for minimum 1% of Free memeory

 

 

minFreeMemoryPercentageToActivateService   is an integer that specifies the minimum amount of free memory that should be available to the system, before a WCF service can be activated.

 

Comments

6/19/2011 12:26:59 PM #

free ad posting

Just about all of the things you assert is supprisingly appropriate and it makes me ponder why I had not looked at this in this light before. Your piece really did switch the light on for me as far as this particular subject goes. Nonetheless there is actually just one position I am not really too comfy with and whilst I make an effort to reconcile that with the central theme of the issue, let me observe just what the rest of your subscribers have to point out.Well done.

free ad posting United States | Reply

Add comment


() (Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading




Sapnep IT Solution

We Provide IT solutions and services to deliver a unique blend of real-business experience with a strong engineering, international project delivery. We are a software development  firm.