About Me

If life is all about change, motion and flow, I would be the one cruising past you on a SunDancer.

Friday, June 20, 2008

Out of Memory errors while enlisting Biztalk Orchestrations using WMI

Most of the tasks in packaging and deploying Biztalk applications can be done using MSBuild and WMI scripts. All these WMI scripts run under the process 'WMIPrvse.exe'.

Orchestration.enlist is one of most memory consuming task that you could come across while starting applications. When you have many Orchestrations in a single dll, you might come across a 'Out of Memory' error claiming not enough memory is available to complete the transaction, while the server has more than enough memory available.

WMI is used by most management consoles behind the scenes to access certain core functions provided by Microsoft products. Windows Server(2k, 2003) installations come with a smaller memory quota, the default being 128MB for WMI objects.

Problem: When we run trusted scripts, that have to handle large transactions, 128MB is not large enough to complete the transaction and errors out with “Out of Memory” errors.

Solution: There are two ways to solve this:
· Update the appropriate registry(which I still don’t know) setting to a value like 384MB. This can be done HOT and is effective immediately.
· Programmatically increment the ‘MemoryPerHost’ property of the WMI Scripting interface. This would need bouncing the server, before this new quota is effective.

Sample VB Script Code:
'Increase WMI Memory quota from a default of 128MB to 384MB to ensure
'we have enough memory available to complete this process

Dim locator: Set locator = CreateObject("WbemScripting.SWbemLocator")
Dim wmi: Set wmi = locator.ConnectServer("", "root")
Dim quota: Set quota = wmi.Get("__providerhostquotaconfiguration=@")
quota.MemoryPerHost = 384*1024*1024
quota.put_()
Wscript.Echo(quota.MemoryPerHost)


References:
http://blogs.clearscreen.com/tomas/archive/2006/11/13/4234.aspx
http://msdn.microsoft.com/en-us/library/aa394671(VS.85).aspx

How to list files checked out in VSS

How to check files checked out by you across all applications

We have all gotten ourselves in situations where Visual studio automatically checks out files when opening a solution, even though we did not mean to make any changes to those projects.

This happens because your local version was different from the version in VSS, Visual Studio prompts an alert box asking if it should merge/checkout/ignore the first time, based on your selection it does this same selection for ever.

VSS allows for users to search for all files that have been checked out by any given user, so that we don’t have a file locked up accidentally for ever or until somebody needs it.

· Log in to VSS using VSS client(not visual studio)
· From menus on top: Select View >> Search >> Status Search
· Under Status Search: Select “Display files checked out by user” and select your user-id
· Under Search Area: Select “Search in all projects”