Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 581111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:32:39+00:00 2026-05-13T14:32:39+00:00

I am building a .NET windows service which is using an unmanaged C++ dll.

  • 0

I am building a .NET windows service which is using an unmanaged C++ dll.
both of my service and the c++ dll are using multi threading.
I am running out of memory after some time (hours) while processing.
I tried to measure the number of threads using “Performance counters”
and I monitors the following values:

# of current logical Threads
# of current recognized threads
# of total recognized Threads

While the first one is steady and its value is reasonable the 2nd and the 3rd are not.
they are always growing and reaching a huge number (over 1500).
And they are equal !!!!

Should they be equal? I also didn’t understand from this page if those counters will count both managed and unmanaged threads.

I suspect that the unmanaged code is alwayes launching new threads instead of reusing them, but I am not sure.

can anyone help?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:32:39+00:00Added an answer on May 13, 2026 at 2:32 pm

    Sounds like a leak. Most likely the unmanaged DLL is not properly disposing of it’s threads.

    In order to really test this write a single threaded app which uses that DLL. Monitor the app. If you notice it’s not disposing of things properly, then you have one of two situations.

    Either you aren’t calling the correct methods in the DLL to close the resources (threads). Or the DLL is badly coded. The first one is easy to fix, the second one will require access to the source code or original developers.

    If it is the DLL and you can’t contact them or they are unwilling to fix, then find something else that does nearly the same thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m building an ASP.NET application, which will create Windows accounts and groups on the
I'm building a .net application with windows forms. I'm pondering on the following problem:
I am currently building a .Net userform using C# and I am populating it
I am building an ASP.NET website which will collect data from a user and
I am building a reusable framework for building scheduling services using the .NET Framework.
I'm building a .Net MVC app, where I'm using one particular view to generate
I have a procedure in VB.net using VS.net 2008 which will get the list
I'm building an app using Windows Azure Table. I've encapsulated all my calls to
I'm going to be building some ASP.Net MVC 2 software using Visual Studio 2010
I'm building a small web application with ASP.NET MVC 2, using db4o as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.