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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:03:25+00:00 2026-05-13T01:03:25+00:00

The memory leak is not happening on every machine, but reliably on a couple

  • 0

The memory leak is not happening on every machine, but reliably on a couple at my work, and it’s looking like close to 10% in the field.

I have a product that uses a Windows service to monitor user input to launch alerts, paired with a visual application that serves only to sit in the system tray, and allow the user to make configuration changes.

I chose to use a remoted object to share the configuration information between the two processes. In the service it is called serviceConfig, and in the visual application it is called configData. The object is created on the server first, and then remoted as follows:

try
{
    InitializeComponent();
    setAppInitDLL(thisDirectory);
    serviceConfig = new serviceConfigData();
    Regex getVersion = new Regex("Version=(?<ver>[^,]*)");
    if (getVersion.IsMatch(Assembly.GetExecutingAssembly().FullName))
    {
        serviceConfig.Version = new Version(getVersion.Match(Assembly.GetExecutingAssembly().FullName).Result("${ver}").ToString());
    }
    // Create the server channel for remoting serviceConfig.
    serverChannel = new TcpServerChannel(9090);
    ChannelServices.RegisterChannel(serverChannel, false);
    RemotingServices.Marshal(this.serviceConfig, "ServiceConfigData");
    baseLease = (ILease)RemotingServices.GetLifetimeService(serviceConfig);
    lock (Logger) { Logger.Write(String.Format("The name of the channel is {0}", serverChannel.ChannelName)); }

    lock (Logger) { Logger.Write("Exiting Constructor"); }
}
catch (Exception ex)
{
    lock (Logger) { Logger.Write(String.Format("Error in Constructor:{0}", ex.Message)); }
}

Then in the visual application I have a private object that I connect using:

configData = (serviceConfigData)Activator.GetObject(typeof(serviceConfigData), "tcp://localhost:9090/ServiceConfigData");

When reading or writing to this object, I have catch statements for Socket Exceptions and Remoting Exceptions which then call this same statement.

On most machines this works without leaking memory, but on some it leaks very quickly. All machines at work have .NET 3.5, some are XP, a couple are Vista. The problem has only been seen on XP machines, and the machines in the field are all XP.

Any ideas where I should be looking, and as a secondary question, should I be using something completely different from this?

  • 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-13T01:03:26+00:00Added an answer on May 13, 2026 at 1:03 am

    My first thought would be to profile the application on the machines you’re seeing the leak with something like Red Gate’s Memory Profiler.

    It’ll be a lot more reliable than attempting to guess what the leak might be.

    As for chosing the right technology, if all your machines will have .NET 3.5 installed you might want to consider migrating to WCF (primarily Named Pipes) for your inter-process communication. Check this SO post for more detail…

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

Sidebar

Related Questions

The following javascript code seems to leak memory but I’m not sure why. I’ve
I seem to have a memory leak and I'm not sure how to fix.
I heard a lot of memory leak vulnerability, but I could not find a
I have cocos2d class which produces memory leak if I do not release autoreleased
I have a memory leak in my iOS app which sometimes causes it to
I have a memory leak on one of the part of my node.js application.
I know that std::vectors do not 'free' the memory when you call vector.clear(), but
Do not unsubscribe from COMObject events can cause memory leak although I use Marshal.FinalReleaseComObject?
Let's make it immediately clear: this is not a question about memory leak! I
I've got a memory leak in Instruments... I've sorted some before, but this one

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.