.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

why do nothing .NET application allocates 500 MB virtual memory?

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :.NET Framework

I'm wondering why an empty .NET console application (only has Console.WriteLine() and Console.ReadLine()) allocates 500 MB of virtual memory?  By the way, this is running on a dual core with hyperthreading.

The 500 MB is allocated when I compile with the 3.5.30729.4926 compiler and don't target any platform.  I'm running Windows 7 x64 so this 500 MB is for the 64 bit application.

If I compile with the 32 bit compiler, 8.00.50727.4927, the 32 bit application allocates 117 MB of virtual memory.



View Complete Post

More Related Resource Links

How to detect and avoid memory and resources leaks in .NET application

Despite what a lot of people believe, it's easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your memory and resources consumption.

I'll explain in this article why memory leaks exist in .NET and how to avoid them. Don't worry, I won't focus here on the inner workings of the garbage collector and other advanced characteristics of memory and resources management in .NET.

Difference Btw Website vs Web application and Virtual directory in IIS 7


May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net


Thanks in Advance.


Visual C++ 6.0: Don't Let Memory Allocation Failures Crash Your Legacy STL Application


Most C++ developers make extensive use of the Standard Template Library (STL) in their code. If you are one of them and are using STL and Visual C++ 6.0 directly out of the box, your application is at high risk of crashing under low memory conditions. The problem arises because checking for failure of operator new is such an uncommon practice. To make things worse, when new does fail, the response is not standard. Some language compilers return NULL while others throw an exception.In addition, if you are using STL in an MFC project, be aware that MFC has its own set of rules. This article discusses these problems, explains how the default behavior has changed in Visual C++ .NET 2003, and outlines the changes you must make if you're using Visual C++ 6.0 so that you can safely use the STL when operator new fails.

James Hebben

MSDN Magazine September 2003

send credentials for virtual directory through application

Hi All,Please let me know that how to send credentials for virtual directory through application.Thanking You...

virtual memory is not released in asp.net

We are getting OutOfMemoryException in our Asp.Net WebService (on a 32 bit machine) and while analyzing the problem we found that when we release some memory in .Net (and call GC just to be sure it is collected), the "Process/Private Bytes" counter of the aspnet_wp goes down, but the "Process/Virtual Bytes" does not. Here is a simple test method: It allocates blocks of 10MB until all the memory is filled. Then it releases everything and finally allocates a 100MB block. (The sleep statements are there so you can observe memory usage in performance monitor)     [WebMethod]     public void MemFragmentationTest()     {       const int allocSize = 10000000;  // 10 MB       List<byte[]> buffers = new List<byte[]>();       // allocate       while (true)       {         try         {           buffers.Add(new byte[allocSize]);           Thread.Sleep(100);         }         catch (OutOfMemoryException)         {  &n

Pass virtual directory credentials through application

Hi All,We have created a website and for the secured files created a virtual directory and in virtual directory properties we selected Application-user(pass through authentication).If any user directly browse the files link then the browser prompts a screen for virtual directory credentials.Here my requirement is i need to send the virtual directory credentials through the application.Please let me know.Thanking You..

Accessing memory of a remote process (x64) from application (x86) - and the other way

Hi everyone, My program access a remote process, e.g. to get the text of ListViewItem. It uses ReadProcessMemory, WriteProcessMemory, SendMessage, LV_ITEM via PInvoke. Below is a little codesnippet. This doesnt work, when i compile for x86 and the remote process is x64 (or the other way). I know that is because the size of IntPtr - and so of the LV_ITEM-Structure - is different. Is there any way, to access x86 and x64 remote processes from the same application?  Is there any way to find out if the remote process is x86 or x64 and make my call's with a suitable LV-Item Structure? thanks Torsten Codesnippet: LV_ITEM lvitem = new LV_ITEM(); // Allocate memory in the remote process's address space string s = string.Empty; IntPtr pszTextMemory = VirtualAllocEx(hProcess,IntPtr.Zero,  1024, (int)(AllocationType.MEM_RESERVE|AllocationType.MEM_COMMIT), (int)(AccessProtectionType.PAGE_READWRITE)); lvitem.pszText = pszTextMemory; ... IntPtr pLVItemMemory = VirtualAllocEx(hProcess, IntPtr.Zero,  Marshal.SizeOf(lvitem), (int)(AllocationType.MEM_RESERVE|AllocationType.MEM_COMMIT), (int)(AccessProtectionType.PAGE_READWRITE)); IntPtr lvItemPtr = Marshal.AllocHGlobal(Marshal.SizeOf(lvitem)); Marshal.StructureToPtr(lvitem,lvItemPtr,false); WriteProcessMemory(hProcess, pLVItemMemory, ref lvitem, Marshal.SizeOf(lvitem), ref written); SendMessage(hListView, LVM_GETITEM

The virtual path '/_catalogs/masterpage/v4.master' maps to another application, which is not allow



i am creating my asp.net solution on the sharepoint(asp.net website)

(i using sharepoint2010-s1 and visual studio2010 and .net3.5)

 i using the code 'this.MasterPageFile=_myTeamSite.MasterUrl'(_myTeamSite is instance of spweb)

when test the code,this point i recieved error:

The virtual path '/_catalogs/masterpage/v4.master' maps to another application, which is not allowed.

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.ArgumentException: The virtual path '/_catalogs/ma

how to free something to increase available Virtual memory sql 2000


MemoryLoad = 60%         
Total Physical = 6141 MB  
Available Physical = 2428 MB                       
Total Page File = 8006 MB 
Available Page File = 3630 MB                      
Total Virtual = 2047 MB   
Available Virtual = 6 MB 

the reason for failure backup, connection is virtual address space run out, see the available virtual is 6MB, is this something to do with, if so can it be increased by freeing something instead of restart the sql?

Memory usage of WPF application continuously increases with time


Hi All,

I have a WPF desktop application. Its memory usage continues to increase (with 4 - 8 K chunks per second) with the time, even if it is sitting idle and doing nothing. How can I control this ?

Below is a abstract list of what is in my application:


  1. We have used images in designing the layout of application windows.
  2. Have used styles in buttons & text boxes (borders, mouse over for buttons, focus gain / lost for text boxes etc.)
  3. Make requests to web services, serialize / deserialize xml for making requests & binding data to lists.
But once my application starts & shows up, I leave it idle, its memory usage increases with time and never stops. When I minimize the application to task bar, its memory usage falls down and jumps up again when I restore it.

Can any one please help me on how to control this continuous increase in memory usage ?

Thanks & regards,


SharePoint Health Analyzer Alert: Application Pool Memory Limit


I receive the below alert in the SharePoint Health Analyzer alerts. Looking at the application pools on my WFE (and my app server), nothing is configured to have a memory limit. I'm wondering if this is maybe a permission issue? My permissions appear to be the same as my other 2010 farm, which does not have this issue and the same setup steps were taken. I don't see any messages in the event log on either server that look to be related.

Has anyone else seen this and resolved it? Or do you have any other tips for things I can look into to resolve it? Thanks in advance.


Application pools recycle when memory limits are exceeded.


0 - Rule Execution Failure




Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

Integrating a Legacy Web Application in SharePoint

This month we will continue with the theme of deploying Microsoft's SharePoint as a company intranet by describing a method for integrating a legacy Web application inside a SharePoint site.

In many companies the intranet site is not just a home page with announcements. It houses Web applications used by many different departments. In last month's article, I built a page to search the employee table in Northwind (the sample database included in Microsoft's SQL Server). This month, I will move the Web pages used to add/remove records from the table into the SharePoint intranet.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

High-Performance .NET Application Development & Architecture

It has always been a goal of project architects to plan an effective strategy from the ground up in regards to an new application. All relevant factors are taken into consideration with respect to the application, from its design and layout to a functional website infrastructure. Pre-.NET strategies and design guidelines still effective now were developed with Microsoft's DNA (Distributed interNet Application) platform. This model successfully served the purpose of architecting N(any number of)-Tier (levels) applications. In its basic sense, as in most robust, distributed applications, you'll architect 3 main layers or Tiers: presentation, business rules and data access.

Application architecture in asp .net

Application Architecture is the most important process of developing a good application. Some people tends to jump into coding without any architecture laid. Later we see those people changing the architecture and finally the application had to be developed from the scratch with the correct architecture.

In this article I will describe some details about how you can improve the architecture of you application. This article is targeted to the beginner's audience.

Improving Application Performance in .Net

Application performance has always been a concern for Web Application developers. This article contains guidelines and tips for maximizing application performance in ASP.NET.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend