Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using Windows 2008 R2 and IIS 7 running on Amazon EC2. IIS is running a single .NET application written in C#.

We are having performance issues and I want to give the application more memory, but I cannot figure out how to do it. How do I control the amount of memory that the CLR gets?

I'm a total newbie with IIS, .NET and the CLR. If I were working with Java, I would just use the -Xmx flag to increase the memory available to the JVM (e.g., -Xmx3000m for 3GB). But, I cannot seem to figure out how to do this in the Windows world.

share|improve this question

1 Answer 1

The CLR hosted in the application pool for the web application will grab as much memory as necessary and then based on memory demand, use garbage collection as needed to free up memory.

You can put limits on the amount of memory accessible to an application pool (in the UI, via the Advanced Settings dialog, or via PowerShell and the WebAdministration module).

You might want to check if there are caps already set for the memory on the application pool, but there really isn't a way to dedicate more memory directly to an app pool without editing the machine.config for the .NET version the app runs under.

EDIT: The default autoconfiguration for memory caps in IIS 7 is 60 percent of the machines RAM. This can be manually increased by editing the machine.config file for the .NET version that your application runs under. Details of the various configuration settings here.

share|improve this answer
    
Thanks Steven. As I watch the Performance Monitor, however, it seems that each worker process in the Application Pool is limited to 1 GB of memory. Is that correct? –  Mark Hansen Oct 3 '12 at 14:46
    
That depends on the settings in the app pool, the amount of RAM on the server, and/or the memory pressure from other applications. By default there are not any caps on memory usage. I've had app pools using 2 or 3 gig of memory. –  Steven Murawski Oct 3 '12 at 14:59
    
How much memory is allocated to your VM? How big is your page file? Is there a lot of swapping to the page file going on? Is RAM the bottleneck for your application or might it be processor? The number of logical processors can impact the number of requests an IIS process can handle. –  Steven Murawski Oct 3 '12 at 15:04
    
I added some additional info as to where you can tweak the memory cap (by default it's 60 percent of the machine memory). But I would also make sure that is your bottleneck. –  Steven Murawski Oct 3 '12 at 15:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.