Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to reduce the CPU Usage?

How to reduce the CPU Usage?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    willbin
    wrote on last edited by
    #1

    Hi, everyone We occurs a problem that our pogram occupies a very high CPU Usage even if with no any operation on it. And we really want to know what leads to the HIGH CPU USAGE? I have searched a lot of topic about this. But... I just consider the large amount of user objects occupies the CPU. But if the large amount of user objects will cause the high CPU Usage? (NOTE:Our project has a large amount of user object of 8597.) THANKS.

    //////////////////////////////

    C 1 Reply Last reply
    0
    • W willbin

      Hi, everyone We occurs a problem that our pogram occupies a very high CPU Usage even if with no any operation on it. And we really want to know what leads to the HIGH CPU USAGE? I have searched a lot of topic about this. But... I just consider the large amount of user objects occupies the CPU. But if the large amount of user objects will cause the high CPU Usage? (NOTE:Our project has a large amount of user object of 8597.) THANKS.

      //////////////////////////////

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      willbin wrote:

      And we really want to know what leads to the HIGH CPU USAGE?

      When your code does stuff, that's all.

      willbin wrote:

      I just consider the large amount of user objects occupies the CPU.

      No - why would it ? They occupy memory. The CPU is occupied if stuff is being done, not if stuff is in memory. Does your project have many threads ? If not, then something must be seriously wrong if your CPU maxes out when you're not doing anything. Otherwise, you have active threads, you need to work out why and if you can change that.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      W 1 Reply Last reply
      0
      • C Christian Graus

        willbin wrote:

        And we really want to know what leads to the HIGH CPU USAGE?

        When your code does stuff, that's all.

        willbin wrote:

        I just consider the large amount of user objects occupies the CPU.

        No - why would it ? They occupy memory. The CPU is occupied if stuff is being done, not if stuff is in memory. Does your project have many threads ? If not, then something must be seriously wrong if your CPU maxes out when you're not doing anything. Otherwise, you have active threads, you need to work out why and if you can change that.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        W Offline
        W Offline
        willbin
        wrote on last edited by
        #3

        Christian Graus wrote:

        Otherwise, you have active threads

        yes.There is a timer event in the project. I removed the timer, the CPU Usage is reduced. THANKS Christian.

        //////////////////////////////

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups