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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:01:27+00:00 2026-06-01T10:01:27+00:00

My application uses some webservice’s and gets connectd to a server and sits on

  • 0

My application uses some webservice’s and gets connectd to a server and sits on the system tray. Application just reads from 3rd part app (local) that is used to connect to the server. If it reads any inappropriate line, then fires/handles appropriate events. Thar’s it. Had tested on our normal working systems and it is working fine. On my system Quad 2.66GHz and 3GB of RAM the app consumes 25 of CPU.

Recently checked on a PIV 3.0Ghz system containing 2GB of RAM system, the application consumes 98 of CPU.

What can this be ? On a better processor the app consumes almost 4 times more of CPU than mine. Why so ? What can be the reasons for the same. Any ideas to handle out the same.

Once connected, this is the code that is active A cmd is run for using 3rd party app and I use this code to read the output of the same:

    private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
    {
        string d = e.Data;

        if (!string.IsNullOrEmpty(d))
        {
            if (sb != null)
                sb.Append(d + "\n");
            //Console.WriteLine("LINE = " + d);
            ERROR_CODE = -1;
            if (d.IndexOf("Initialization Sequence Completed") >= 0)
            {
                connected = true;
                Console.WriteLine("********* Connected = " + connected);
                return;
            } else if (isInValidLine(d))
            {
                if (d.IndexOf("Exiting") >= 0 || d.IndexOf("The requested name is valid but does not have an IP address.") >= 0)
                {
                    if (caughtExp == false)
                    {
                        connected = false;
                        caughtExp = true;
                        errorMsg = d;
                        ERROR_CODE = ERROR_EXIT;
                        OnOpenVpnDisConnectionEvent();
                    }
                }
                else if (d.IndexOf("errno=", StringComparison.OrdinalIgnoreCase) > 0
                    || d.IndexOf("error:2006D080", StringComparison.OrdinalIgnoreCase) >= 0
                    || d.IndexOf("code=995", StringComparison.OrdinalIgnoreCase) >= 0
                    || d.IndexOf("There are no TAP-Win32 adapters on this system", StringComparison.OrdinalIgnoreCase) >= 0
                    || d.IndexOf("Error opening configuration file", StringComparison.OrdinalIgnoreCase) >= 0
                    || (d.IndexOf("CreateIpForwardEntry: Access is denied.", StringComparison.OrdinalIgnoreCase) >= 0 
                                        && d.IndexOf("[status=5 if_index=", StringComparison.OrdinalIgnoreCase) >= 0)
                    || d.IndexOf("CreateFile failed on TAP device") >= 0  )
                {
                    // Want to handle all and go for ReConnect, atmost possible
                    caughtExp = true;
                    connected = false;
                    errorMsg = d;
                    ERROR_CODE = ERROR_FATAL;
                    OnOpenVpnDisConnectionEvent();
                }

                return;
            }
        }
        return;
    }

    private bool isInValidLine(string line)
    {
        if (line.IndexOf("errno=", StringComparison.OrdinalIgnoreCase) >= 0 
            || line.IndexOf("error:2006D080", StringComparison.OrdinalIgnoreCase) >= 0
            || line.IndexOf("code=995", StringComparison.OrdinalIgnoreCase) >= 0
            || line.IndexOf("There are no TAP-Win32 adapters on this system", StringComparison.OrdinalIgnoreCase) >= 0
            || line.IndexOf("Error opening configuration file", StringComparison.OrdinalIgnoreCase) >= 0
            || line.IndexOf("Exiting") >= 0
            || line.IndexOf("The requested name is valid but does not have an IP address.") >= 0
            || line.IndexOf("CreateFile failed on TAP device") >= 0    // && (line.IndexOf("General failure (ERROR_GEN_FAILURE) (errno=31)") >= 0) ) 
            )
        {
            return true;
        }

        return false;
    }

Why does it take so much of CPU on that system ?

Any help is highly appreciated.

  • 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-01T10:01:28+00:00Added an answer on June 1, 2026 at 10:01 am

    It consumes all the available CPU in the execution thread: almost 100% for a single core, 25% for a 4 cores CPU (100% of the core where it’s executing).

    As pointed by @Douglas it may be the result of a loop or a simply your application consumes data more slowly than their production).

    If this is its behavior then it’ll use all available CPU time. If you do not want to use all CPU time (because it slows down your system or it consumes too much battery) you may decrease process priority. You can’t set the priority of the System.Windows.Forms.Timer object (it has the priority of the process). The question is do you really have to call that function so often? When minimized can’t you disable it? Anyway I’m thinking: application is consuming 100% of one core only for make-up…I understand it’s annoying to change something that works but…

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

Sidebar

Related Questions

My application uses some session variables that are timing out even though I thought
I have a winform application that uses some referenced web services to get data.
I have a .NET application that uses some API calls, for example GetPrivateProfileString .
I have a Windows Forms application that uses some Application.Idle handlers to change the
I am working on a C# WinForms application that uses some DevExpress controls. I
My application uses MS access database to save some sensitive information. Though that information
I have client application that uses WCF service to insert some data to backend
I have an application that uses simple sockets to pass some characters between two
I have an application that uses MSWord automation to edit some documents, after they
I built a Delphi-7 Windows Application which uses some web services. The application is

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.