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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:01:49+00:00 2026-05-19T16:01:49+00:00

I have a class with a finalizer. But since I’m always calling Dispose() and

  • 0

I have a class with a finalizer. But since I’m always calling Dispose() and Dispose() is calling GC.SupressFinalize(this), I think my object never actually makes it into the finalization queue. The finalizer is just in there as a backstop in case another user of the class forgets to call Dispose().

Is there any performance penalty for just implementing a finalizer even if its never called and the object never makes it to the finalization queue?

I used to think not, but on page 102 of Effective C#: Second Edition by Bill Wagner, it says, “Even if it’s never called, the presence of a finalizer does introduce a rather large performance penalty for your types.”

  • 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-19T16:01:50+00:00Added an answer on May 19, 2026 at 4:01 pm

    Is there any performance penalty for just implementing a finalizer even if its never called and the object never makes it to the finalization queue?

    As long as you implement this correctly, and call GC.SuppressFinalize on your object, the “penalty” will only occur when the user does not call Dispose().

    That being said, the “severe” penalty is actually not all that severe in most cases. It would be a problem if you had many short lived objects with finalizers polluting your garbage collection process, but that’s rarely a problem, since objects with finalizers are rare (overall).

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

Sidebar

Related Questions

I have the following class which is a decorator for an IDisposable object (I
Let's say I have class A(<class ...>): pass . Should I be explicitly calling
i do this in the education purpose. such is idea: i have class Array.
i have class call example1 this class defines a background, and i want to
I have body tag's class like this <body class=cms-page-view cms-home> This body tag have
I have class method that returns a list of employees that I can iterate
I have: class MyClass extends MyClass2 implements Serializable { //... } In MyClass2 is
I have class A: public class ClassA<T> Class B derives from A: public class
I have class with internal property: internal virtual StateEnum EnrolmentState { get { ..getter
I have class with a member function that takes a default argument. struct Class

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.