How Can I Release Memory from an SSIS Loop Container on Windows Server 2003?

Hey, Scripting Guy! When I use a For loop to cycle through a container a number of times when running another package, I have needed to reboot the server to release memory so that the server could continue to function. I expanded the page file to prevent server freezing, but I see that when the SSIS package ends, the page file utilization remains at a high level. Is there a script that can be run from SSIS to release memory from a SSIS Loop Container on a Windows 2003 Server upon completion of the script? Apparently, this memory loss is a known problem.

-- SD

Hello SD,

Microsoft Scripting Guy Ed Wilson here. Wow. You lost me at SSIS package. I am not sure what that is, but it really does not matter. I know of no way, via script, to manipulate the page file and to force something to release memory other than stopping and restarting processes. The problem on SQL Server is that if you choose to stop and restart the SQL service, if it is Microsoft SQL 7 or above, you lose the cached execution plans and other things that are used by SQL to improve performance. The SQL process will always expand to consume all the available memory on a server to eventually cache portions of the database in memory.

If your SSIS program has a memory leak, the maker of the program should fix the problem. If it is a Microsoft product, a support case should be opened with our Customer Support Services. Running a script, and then rebooting the server is not a very productive method of management, and certainly not be taken as a standard operating procedure.

Tell Me About Scripting for Windows Vista

Hey Scripting Guy! Hi! I would like to know where I could find information on scripting and syntax (code) for Windows Vista, and what software I could use to write it. In addition, I would like to know if C++ could achieve these same results somehow. I want to do real basic things such as turn an integrated camera or microphone on and off. I think this is basic, but might require some more knowledge. Thanks in advance!

-- CP

Hello CP,

In Windows Vista you can use VBScript to do many things. Scripts that worked all the way back to Windows 2000 for the most part will still run on Windows Vista. There have been a few additions over the years, and even a few improvements in Windows Vista, but all in all, it is the same. We have a Scripting for Vista pageat the TechNet Script Center that might give you a few ideas.

If it were I, however, I would download and install Windows PowerShell 2.0 onto my Windows Vista machine. Windows PowerShell 2.0 is extremely powerful because it provides nearly complete access to the .NET Framework and even allows you to run Win32 APIs and other unmanaged code.

To control your camera, microphone, and whatnot is not really basic scripting. In fact, I believe you will be writing in C++ or at least calling the Win32 APIs from Windows PowerShell 2.0. If you decide to do this, you may wish to look at the PInvoke wiki, which is what I use because the method signatures can get rather complicated for those who are not using it on a daily basis.

At any rate, I think it will be a fun and most excellent project. I would love to see your code when you get it finished, so please share it on the Script Repository.

Can I Send Data from a VBScript Script to an Already Opened Microsoft Excel Workbook?

Hey, Scripting Guy! How can I send data from a VBScript script to an already opened Microsoft Excel workbook without opening a new Excel object?

Hey, Scripting Guy! Thanks for publishing thatgreat article about adding help to a Windows PowerShell script. That table of available leafs was particularly useful. My concern or should I say frustration would be around .Inputs and .Outputs and the whole .NET access with Windows PowerShell. I have loved being able to use .NET instead of WMI for things like ping and .NET for accessing WSUS, but I have limited exposure as an system administrator to .NET. I have tried to read and teach myself, but I am just concerned there is potential that Windows PowerShell will never reach in many system administrators’ hands.

-- JK

Hello JK,

I am glad you enjoyed the article. Regarding inputs and outputs, you do not need to have those tags if you do not wish. I like to add them because it is helpful information. I use the Get-Member cmdlet to see what kind of object I am using. For example, I recently wrote a function for Microsoft Visio Week that will convert disk space from bytes to megabytes, gigabytes, and terabytes. I “figured” the input was an int32 and used this constraint on the function: [int32]. The function worked sometimes, but other times it would fail. Bummer! It is particularly distressing when you are automating Visio and have never done that before!

I removed the constraint, and the function worked perfectly! Strange, I thought. Then I used the Get-Member cmdlet on some of my data types and discovered that a terabyte expressed in bytes is an Int64 and not an int32. I found this out by using the syntax seen here:

Having this kind of unexpected information in the inputs and outputs is helpful, and it aids in learning some of the finer points of Windows PowerShell.

What Are the Best Online WMI References?

Hey, Scripting Guy! I thought you might have an opinion about the best online reference for building WMI event queries. I am working on documenting WMI event monitors and want to provide a reference about how to build the query.

By the way, do not forget the 2010 Scripting Games begin on April 26. Beginners are encouraged to give it a go because you will learn a lot and have a ton of fun. Follow the Scripting Wife as she progresses in her quest to be the first Scripting Wife to ever compete in the Scripting Games. Because she is a complete novice when it comes to scripting, she can help you learn scripting in a way that no one else can—she feels your pain and shares your joys. Not only that, she is really cool.