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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:16:58+00:00 2026-06-05T17:16:58+00:00

There is a memory leak in a legacy application, so I don’t know the

  • 0

There is a memory leak in a legacy application, so I don’t know the code very well. I analyzed with MemProfiler and found out that a growing number of objects is referenced by TimerCall objects. These TimerCallbacks are referenced by _TimerCallback objects and these are children of the root. The graph looks like Root -> _TimerCallback -> TimerCallback -> MyObject.

Since MyObject needs a TimerCallback in its constructor there are several calls like:

new MyObject(int timeout, new TimerCallback(SomeCallbackMethod));

To be honest it looks quite awkward to me to do it like this, but as I wrote it’s a legacy application and it was written in “C style” C#, with lots of null assignments and Dispose() calls …

So how can I remove these references to TimerCallback from root?

  • 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-06-05T17:17:01+00:00Added an answer on June 5, 2026 at 5:17 pm

    This looks like your TimerCallback is being used in a Timer object. Find out, why there are a lot of Timers active. They are likely to be the real roots keeping your callback alive.

    I was just looking around the _TimerCallback class in Reflector and although I don’t fully comprehend what’s going on I think this class is a red herring. I think the root cause are Timers (maybe even disabled ones).

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

Sidebar

Related Questions

There is a memory leak in my application. The memory consumption shoots up after
It seems like there is memory leak in this piece of code.I am using
In the following code, there is a memory leak if Info::addPart1() is called multiple
I can't find a cause for a memory leak in my application. I found
Hi please tell me if there is any memory leak in my code or
Memory leak is, when there is unused memory in application and GC can collect
Is there a memory leak in the following code example as I have allocated
There are some memory leaks found out when i profile my app with Instruments.
Is there a way/tool to check memory leak of Cocoa Touch project? or I
Yes, I know there are four Memory windows, but I much prefer the display

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.