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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:42:54+00:00 2026-05-26T06:42:54+00:00

I have a client/server app. The server component runs, uses WCF in a ‘remoting’

  • 0

I have a client/server app. The server component runs, uses WCF in a ‘remoting’ fashion (binary formatter, session objects).

If I start the server component and launch the client, the first task the server does completes in <0.5sec.

If I start the server component with VS debugger attached, and then launch the client, the task takes upwards of 20sec to complete.

There are no code changes – no conditional compilation changes. The same occurs whether I have the server component compiled and running in 32-bit, 64-bit, with the VS hosting process, without the VS hosting process, or any combination of those things.

Possibly important: If I use the VS.NET profiler (sampling mode), then the app runs as quick as if there were no debugger attached. So I can’t diagnose it that way. Just checked, instrumentation mode also runs quickly. Same for the concurrency profiling mode, works quickly.

Key data:

  • The app uses fairly heavy multithreading (40 threads in the standard thread pool). Creating the threads happens quickly regardless and is not a slow point. There are many locks, WaitHandles and Monitor patterns
  • The app raises no exceptions at all.
  • The app creates no console output.
  • The app is entirely managed code.
  • The app does map a few files on disk to a MemoryMappedFile: 1x750MB and 12x8MB and a few smaller ones

Measured performance:

  • CPU use is minimal in both cases; when debugger is attached, CPU sits at <1%
  • Memory use is minimal in both cases; maybe 50 or 60MB in both cases
  • There are plenty of page faults happening (ref MMF), however they happen more slowly when the debugger is attached
  • If the VS hosting process is not used, or basically the ‘remote debugging monitor’ comes into play, then that uses a decent amount CPU and creates a good number of page faults. But that’s not the only time the problem is occurring
  • The performance difference is seen regardless of how the client is run. The only variable being changed is the server component being run via ‘Start with debugging’ vs launched from Explorer.

My ideas:

  • WCF slow when debugged?
  • MemoryMappedFiles slow when debugged?
  • 40 threads used – slow to debug? Perhaps Monitors/locks notify debugger? Thread scheduling becomes strange/context switches very infrequent?
  • Cosmic background radiation granting intelligence and cruel sense of humour to VS

All seem stupidly unlikely.

So, my questions:

  1. Why is this happening?
  2. If #1 unknown, how can I diagnose / find out?
  • 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-26T06:42:55+00:00Added an answer on May 26, 2026 at 6:42 am

    Exceptions can notably impact the performance of an application. There are two types of exceptions: 1st chance exceptions (the one gracefully handled with a try/catch block), and unhandled exceptions (that will eventually crash the application).

    By default, the debugger does not show 1st chance exceptions, it just shows unhandled exceptions. And by default, it also shows only exceptions occurring in your code. However, even if it does not show them, it still handles them, so its performance may be impacted (especially in load tests, or big loop runs).

    To enable 1st chance exceptions display in Visual Studio, click on “Debug | Exceptions” to invoke the Exceptions dialog, and check “Thrown” on the “Common language runtime” section (you can be more specific and choose wich 1st chance exception you want to see).

    To enable 1st chance exceptions display originating from anywhere in the application, not just from your code, click on “Tools | Options | Debugging | General” and disable the “Enable Just My Code” option.

    And for these specific “forensics mode” cases, I also strongly recommend to enable .NET Framework Source Stepping (it requires “Enable Just My Code” to be disabled). It’s very useful to understand what’s going on, sometimes just looking at the call stack is very inspiring – and helpful especially in the case of cosmic radiation mixup 🙂

    Two related interesting articles:

    • How to debug crashes and hangs
    • Configuring Visual Studio to Debug .NET Framework Source Code
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we have a client/server app (Flex and Java) that uses BlazeDS to do remoting.
We have a huge client/server WinForms app that uses .NET remoting to pass DAOs
I have a client app and a server app. The client calls a wcf
I have an ASP.NET MVC server app and client code which uses jquery. I'd
I have a WCF client/server app which is communicating over HTTP using the WSHttpBinding.
We have client server based app which saves user related data into a zip
I have a simple client-server app on android. the android service communicates with the
I`m writing client-server app for windows using WinSock and I have class for server.
I have been building a client / server app with Silverlight, web services, and
The scenario is that we have a client/server app with the client install being

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.