none
Counter Name

    Question

  • Hallo,

    I am making a program but I don't get the counter name option %committed bytes in use. Can you guys please help me.

    Thanks a lot.

    Silke Liefting


    Sl

    Saturday, April 8, 2017 7:56 PM

All replies

  • I'm sorry, your question isn't clear. Where are these counter name and %commited bytes? Could you please include some code that you've already written, along with pointing out where the problem is?

    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Saturday, April 8, 2017 8:08 PM
    Moderator
  • Hallo Bonnie DeWitt,

    I want to see my RAM usage in a progress bar, I made a Performance Counter, in the performance counter I selected by category name memory, and by Counter name I want to select %committed bytes in use but the option isn't there.

    Here is my code.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace Admin1
    {
        public partial class <g class="gr_ gr_243 gr-alert gr_gramm gr_run_anim gr_inline_cards Style multiReplace" data-gr-id="243" id="243">Home :</g> MetroFramework.Forms.MetroForm
        {
            public Home()
            {
                InitializeComponent();
            }

            private void progressBar1_Click(object sender, EventArgs e)
            {

            }

            private void Home_Load(object sender, EventArgs e)
            {

            }

            private void timer1_Tick(object sender, EventArgs e)
            {
                progressBar1.Value = (int)(Cpu.NextValue());
                label3.Text = ""+ progressBar1.Value.ToString() +"%";

            }

            private void timer2_Tick(object sender, EventArgs e)
            {
              
            }
        }
    }


    Sl

    Saturday, April 8, 2017 8:38 PM
  • I did a drag-and-drop of a Performance Counter to my Windows Form. In the Properties, I selected "Memory" from the list for CategoryName and then in the list for CounterName, "% Committed Bytes In Use" was the very first item in the list. This is for the System.Diagnostics.PerformanceCounter class ... is that the one you are using? BTW, I don't see anything in the code you posted for anything resembling a PerformanceCounter...

    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Saturday, April 8, 2017 9:13 PM
    Moderator
  • If you click the "show description" checkbox, then it will show a description of the counter at the bottom of the window.

    The description for % Committed Bytes In Use says:

    % Committed Bytes In Use is the ratio of Memory\\Committed Bytes to the Memory\\Commit Limit. Committed memory is the physical memory in use for which space has been reserved in the paging file should it need to be written to disk. The commit limit is determined by the size of the paging file. If the paging file is enlarged, the commit limit increases, and the ratio is reduced). This counter displays the current percentage value only; it is not an average.

    PS:  I just noticed the mismatched close parenthesis in the description.  That's a bug.

    Sunday, April 9, 2017 3:26 AM