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

  • Home
  • SEARCH
  • 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 711099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:41:48+00:00 2026-05-14T04:41:48+00:00

I have an external (.Net) dll that I have to use for an application.

  • 0

I have an external (.Net) dll that I have to use for an application. Unfortunately that dll has several known memory leaks. We are working on getting the authors of the dll to fix the memory leaks, but in the mean time I was wondering what is the best way to use the dll without having to deal with the memory leaks?

  • 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-14T04:41:49+00:00Added an answer on May 14, 2026 at 4:41 am

    Moving the .Net assembly into its own AppDomain so you can unload the module periodically may help if the leaks are due to hanging onto object references “too long”, but most “memory leak” situations I’ve run into in .Net managed code are actually failure to release unmanaged resource handles – releasing handles, closing files, closing network connections, etc.

    If the resources are owned by a responsible .Net managed object that releases its unmanaged handles in IDispose.Close(), but some bonehead code isn’t calling IDispose.Close when it’s supposed to, forcing a GC cycle or unloading the assembly’s AppDomain may help reclaim those orphaned unmanaged resources by “hurrying up” the eventual GC disposal of the owning managed objects.

    If the handles are owned by bonehead code that doesn’t release them properly at all, unloading the assembly’s AppDomain is unlikely to help reclaim the orphaned handles.

    Most Windows resources associated with handles will be recovered when the process terminates. This is a bit extreme, but if GC and AppDomain cycling don’t help, you could write a wrapper around the offending .NET assembly classes and use .NET remoting to jettison the offending assembly from your process entirely. How much data interaction goes on between the offending assembly’s classes and the rest of your app will determine whether this is at all feasible. If the offending assembly is fairly self-contained with a smallish number of interfaces entry points, this could be doable. With the offending assembly in its own process, you could shut it down periodically to purge the accumulated cruft, without having to shut down your own process.

    Definitely hold that last idea for the absolute last resort. Try to find out what kind of memory or resource is being leaked and how it’s being leaked and whether AppDomain cycling will reclaim the lost resources.

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

Sidebar

Related Questions

I have a ASP.net application that is referencing a external assembly that I need
We have several external DLL files being referenced in our Web Application Project. We
I have an external stylesheet that has specific IE-hacks. Every so often my site
I have a website project. It has assembly references to external DLLs that we
Hey. We're building a large ASP.NET website, and have hired an external firm to
We have an external service that is currently accessible via the http (port 80,
I have an external DLL whose source code is C#. From the documentation for
I have an external JavaScript that contains: function random_imglink(){ var myimages=new Array() myimages[1]="http://sevir.sitegoz.com/jchs/Banner1.png" myimages[2]="http://sevir.sitegoz.com/jchs/banner2.png"
I have an external device that spits out UDP packets of binary data and
We have a third-party DLL that can operate on a DataTable of source information

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.