1

Is there any way that I can limit virtual size for a particular Process e.g. W3WP process(32 bit, Windows Server 2003)?

I have a service which is hosted in IIS(C#) which will Get/Reserve/Confirm slots based on the User operation. I didn't get any error in the logs. All the Http error codes which I have got is 200. An increase in memory utilization and Garbage Collection growing in size followed by out of memory exceptions before the servers stopped taking any further website requests.

Because I'm getting OOM (Out of Memory exception for Our application which is mainly because of peak virtual memory utilized by the application), I'm trying to replicate OOM by reducing the available resources.

Community
  • 1
  • 1
Harrish
  • 111
  • 1
  • 6
  • Google:`iis application pool memory limit` seems to contain your answer. Your questions is non-coding off-topic. See also other http://stackexchange.com/sites – xmojmr Dec 17 '14 at 11:43
  • xmojmr: IIS application pools recycle when it reaches some memory limit, which we can set in IIS. – Harrish Dec 17 '14 at 11:57
  • What does W3WP do for you? What does the "we are getting OOM" mean? How does the error call stack dump look like? Which programming language is your application written in? http://stackoverflow.com/help/on-topic: "_Professional system and network administrators, ask on Server Fault_". – xmojmr Dec 17 '14 at 12:04
  • We have a service which is hosted in IIS(c#) which will Get/Reserve/Confirm slots based on the User operation. We didn't get any error in the logs.All the Http error codes which we have got is 200.An increase in memory utilisation and Garbage Collection growing in size followed by out of memory exceptions before the servers stopped taking any further website requests. – Harrish Dec 18 '14 at 09:43

1 Answers1

1

I don't know. The memory management (dynamic heap size, dynamic stack size) is almost automatic.

From the perspective of the OS it is driven by fields SizeOfHeapReserve and SizeOfStackReserve in the Portable Executable (PE) file header. This header is constructed by the language compiler and embedded into the *.exe or *.dll file. Values present in the header are used by the PE Image Loader to initialize the process upon it's creation.

However, the language runtime can later decide to use any other values when creating new threads (see dwStackSize in MSDN: CreateThread function) or when allocating new memory heaps (see dwMaximumSize in MSDN: HeapCreate function).

Changing System.Diagnostics.Process.MaxWorkingSet from inside the running process probably would not work.

But I have found a promise:

CodeProject: Sebastian Solnice, Set process memory limit with Process Governor, 2013

...Process Governor... allows you to set a limit on a memory committed by a process. On Windows committed memory is actually all private memory that the process uses. I wrote this tool to test my .NET applications (including web applications) for memory leaks. With it I can check if under heavy load they won’t throw OutOfMemoryException

...How it works? Process Governor uses a system job object to apply constraints to a process...

See also:

Community
  • 1
  • 1
xmojmr
  • 8,073
  • 5
  • 31
  • 54