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 4057690
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:59:05+00:00 2026-05-20T14:59:05+00:00

Folks – I’m creating many COM servers (I’m launching numerous EXEs) in .net, talking

  • 0

Folks – I’m creating many COM servers (I’m launching numerous EXEs) in .net, talking to COM via COM -interop, using numerous COM objects in the server, etc. If I kill the process, is there any harm? Is there anything bad about NOT releasing all the COM objects I’ve used via Marshal.FinalReleaseComObject()? Will I have a memory leak over time?

  • 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-20T14:59:06+00:00Added an answer on May 20, 2026 at 2:59 pm

    I’ll assume you are talking about out-of-process COM servers although they are far less common than in-process servers. Killing the client app is bad, the server will never get the release calls, the resources for any objects that the client allocated will stay in use until the EXE is terminated. Killing the server app is going to make the client app fail with RPC errors, nothing is leaked.

    There’s nothing bad about not using Marshal.FinalReleaseComObject(), COM object reference counts are managed by the RCW (runtime callable wrapper). It is a managed object like any other in .NET programming, the garbage collector takes care of it. The reference count is decremented when the finalizer runs. It is unpredictable when that happens.

    Using Final/ReleaseComObject() can make it predictable but you have to call it on every object you create. Which can be difficult, it isn’t always obvious that you created one when you use the indexer for example. It is also dangerous, mis-timing the call or not properly tracking all references to the object causes the infamous “COM object that has been separated from its underlying RCW cannot be used” exception. A good war story is available here.

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

Sidebar

Related Questions

Folks, Debugging a .net 4.0 app using WinDbg (I'm a beginner to WinDbg). I'm
Folks, I've got a stack overflow in my .net 4.0 app. using WinDbg I've
I wanted to see if folks were using decimal for financial applications instead of
Folks, I'm creating a new WCF Service and started with my Service interface. Looks
Folks, I'm building a pretty standard workflow that I want exposed via a WCF
Folks, in my application I'm using clock_gettime(CLOCK_MONOTONIC) in order to measure the delta time
Do folks have any guidance on when a simple .NET property that fires INotifyPropertyChanged.PropertyChanged
Folks, I have an ASP.NET project which is pretty n-tier, by namespace, but I
Folks, I need a solution that allows drag-and-drop cell over the table. The cells
Folks, we all know that IP blacklisting doesn't work - spammers can come in

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.