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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:40:01+00:00 2026-06-02T16:40:01+00:00

Currently, I have to fix an existing Silverlight application that’s leaking a lot of

  • 0

Currently, I have to fix an existing Silverlight application that’s leaking a lot of memory. Using Redgate’s ANT profiler I managed to detect possible problems. One of them is a static class that wraps around a web service, which contains two event handlers to support an asynchronous calculation.
And you’ve guessed it… A lot of objects assign an event to this handler but most don’t release it again. As a result, those objects are linked to these static events and thus almost never released…

I need a simple fix to work around this problem. So, what possible options do I have to fix this memory leak without these changes having a lot of impact?

Making the event handlers non-static will result in a huge change, thus an undesired action…

  • 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-02T16:40:03+00:00Added an answer on June 2, 2026 at 4:40 pm

    Use the Weak Event pattern (don’t know if it’s possible with SL). This will allow a dirtier programming model with calling your static method.

    A better alternative whould be to properly subscribe / unsubscribe events (agreeing with tomasmcguinness), but this implies you can change the calling code and/or ask the consumers to better develop.

    Another solution could to use async patterns. Maybe waiting for a Callback delegate in your method call, or even better, return a Task object.

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

Sidebar

Related Questions

I have an existing application that I'm supposed to take and create a mini
I currently have a web application that is utilizing Spring Security hosted on a
I currently have some code that draws using pycairo and renders to an SDL
Currently have a drop down menu that is activated on a hover (from display:none
I currently have a XSLT 2.0 Stylesheet that I am trying to remove empty
I currently have one project that currently contains multiple packages. These packages make up
I currently have a deployed app (fortworth.herokuapp.com) that I am attempting to sort movies
We currently have one publisher and four subscribers using merge replication. Due to a
I currently have a GridView scrolling vertically, and everything works fine. But now that
I currently have a webview that displays a current site. However, it cuts off

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.