ZengJeff-0760 avatar image
0 Votes"
ZengJeff-0760 asked Monalv-msft edited

Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage resource leak

Our product is a COM object and running under the control of COM+ service. The purpose of the COM object is to load a package from a .dtsx file and execute the package. For certain package, I found after Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage is called, some threads will be created. The call stack of the threads likes:
After the package is executed, the threads are not released. So when our COM object processes a new package, more threads will be created and it cause memory/resource leak.
Does any one know how to release these threads or a loaded package?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Monalv-msft avatar image
1 Vote"
Monalv-msft answered Monalv-msft edited

Hi @ZengJeff-0760 ,

May I know if you can share the components in the ssis package?

You can run Integration Services packages as needed or at predetermined times by using the methods described in Running Packages. However, with only a few lines of code, you can also run a package from a custom application such as a Windows Forms application, a console application, an ASP.NET Web form or Web service, or a Windows service.

Please refer to the following links:
1.Loading and Running a Local Package Programmatically
2.Application.LoadPackage Method

Best regards,

If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


I uploaded the package file. I have the same issue if I load the package in a console application.

0 Votes 0 ·
validations.xml (109.5 KiB)

Hi @ZengJeff-0760 ,

It seems that the package file is broken.

Please find the initial ssis project and load the existing project to a solution.

Please refer to Add Copy of Existing Package and Add an existing project to a solution.

Best regards,

0 Votes 0 ·


Our customer provided a .ispac file to me and I uploaded the new package file.

0 Votes 0 ·
validations.xml (109.6 KiB)


I used my console application to load the new package file and the threads will be created again. Any idea why the threads will be created?

0 Votes 0 ·
thread.jpg (204.3 KiB)

We have some customized tasks and used in the package. I tried to remove these tasks from the package and use the console application to load it again. There were less MSVCR120 threads created. The customized tasks inherit from Microsoft.SqlServer.Dts.Runtime.Task. Do I need to implement some methods or interfaces in the customized tasks so that the threads can be released?

0 Votes 0 ·