w3wp.exe process is an IIS web application process to handle the client request for the application pool. Exchange server services heavily utilized w3wp process not only to handle users request from external but themselves make web service requests among Exchange server members using virtual directories (Owa, OAB & Powershell etc) and respective App pools. Unless you have not configured periodic recycling for Application Pool, you may need to do manual recycle to avoid memory leaks. Microsoft Technet states that:Internet Information Services (IIS) application pools can be periodically recycled to avoid unstable states that can lead to application crashes, hangs, or memory leaks. By default, application pool recycling is overlapped, which means that the worker process that is to be shut down is kept running until after a new worker process is started. After a new worker process starts, new requests are passed to it. The old worker process shuts down after it finishes processing its existing requests, or after a configured time-out, whichever comes first. This way of recycling ensures uninterrupted service to clients. However, if an application in the application pool cannot run more than one instance of itself at a time, overlapping rotation can be disabled [source:Technet]
As shown in Fig-1, you can see the MsExchangePowershellFrontEndAppPool is consuming much memory which visually hits in the task manager. This may be due memory leaks or we may need further analysis on App Pool. Anyway, we need to recycle that pool without restarting the IIS.
1) First check whether the automatic recycle is enabled. From IIS management console, select the application pool and on the right pane, under the Edit Application Pool, click the Recycling…. See Figure-2. You can also do automatic application pool recycle settings with your desired criteria. (Every 2 hrs, 12:00PM daily or when specific virtual/private memory hits to specific threshold).
2) Since, we do not have the automatic App Pool recycle, we manually recycle it.
Now, the w3wp process and respective App Pool are back to normal. See Figure-4.
Note: This is also applicable to web servers which uses managed web service & .net applications.