Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi i have following code and it is enough just if i click on blue window then cpu goes to 100% for like at least one minute even with my i7 4 cores. I just check even with empty project and is the same !!!

public class Game1 : Microsoft.Xna.Framework.Game
    GraphicsDeviceManager graphics;
    SpriteBatch spriteBatch;
    private Texture2D cursorTex;
    private Vector2 cursorPos;
    GraphicsDevice device;

    float xPosition;
    float yPosition;

    public Game1()
        graphics = new GraphicsDeviceManager(this);

        Content.RootDirectory = "Content";


    protected override void Initialize()
        Viewport vp = GraphicsDevice.Viewport;

        xPosition = vp.X + (vp.Width / 2);
        yPosition = vp.Y + (vp.Height / 2);
        device = graphics.GraphicsDevice;

    protected override void LoadContent()

        spriteBatch = new SpriteBatch(GraphicsDevice);
        cursorTex = Content.Load<Texture2D>("strzalka");

    protected override void UnloadContent()
        // TODO: Unload any non ContentManager content here

    protected override void Update(GameTime gameTime)
        // Allows the game to exit
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)


    protected override void Draw(GameTime gameTime)


        spriteBatch.Draw(cursorTex, cursorPos, Color.White);
share|improve this question
seems this is the answer – kosnkov Apr 8 '12 at 19:59
That is only the answer for some CPUs. Releasing a product with fixedtimestep set to false by default will generally be bad, as it will cause the program to try and achieve the highest framerate possible, which will usually result in much higher CPU and GPU usage. – Nic Foster Sep 10 '12 at 21:37
Could this be an anomaly? Bad DirectX install? Windows having fun at your expense? Visual Studio having a panic-attack? – Cypher Sep 10 '12 at 22:48
@Cypher: Good question. I've never had issues with the fixed time step, it's always worked for me as advertised. The link provided in the first comment to the OPs post is the first I've heard of people having to turn off the fixed time step to actually lower CPU usage. – Nic Foster Sep 10 '12 at 23:30

Having a single core go to 100% while running the game loop is common, even in the boilerplate project. Games run a continual update/draw loop. Though you'll see different frequency for Update() vs Draw() depending on what your game is doing, they're both running in a fast loop.

If it's starting after the mouse click, I'm guessing it's because that's when the app becomes active.

share|improve this answer

Answer for most XNA users: This is because your game is probably running at the highest framerate it can. You can fix the framerate to solve this problem.

Inside of your function public Game1() place this code: this.IsFixedTimeStep = true

For some CPUs setting IsFixedTimeStep to true will not solve the issue. This is an XNA problem. Setting it to false will cause the application to loop with no delays between frames, allowing the framerate to go as high as the computer can get it to go. This will cause GPU usage to be higher for any users of your application, and higher CPU usage for any user that isn't experiencing the issue that the OP is.

Answer for the OP: XNA has issues with certain CPUs it seems like, in your specific case you'll want to set this.IsFixedTimeStep = false

It's also worth noting that even with IsFixedTimeStep is set to false, when the XNA window loses focus it will revert back to a fixed time step so that the application doesn't kill the performance of other applications when it's not in focus.

share|improve this answer
IsFixedTimeStep It's by default set on true. – fuex Apr 9 '12 at 22:21
@Fuex, indeed that is the case, but I don't see any way that a simple program like that would consume 100% CPU unless it was running without frame limits. By default XNA will limit the framerate when the window doesn't have focus, so his explanation of the framerate jumping when the window is clicked seems to suggest it may be that the framerate is not fixed. – Nic Foster Apr 10 '12 at 15:04
The answer in the comment of OP notes that it should be set to False not True. – joltmode Aug 7 '12 at 6:12
As Tom says, this is the wrong answer, the right one is in the comment by kosnkov. – Tristan Warner-Smith Sep 6 '12 at 14:05
More information on what Game.FixedTimeStep actually does:… – Cypher Sep 10 '12 at 22:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.