# What would cause Windows to report 'High Power' use?

**URL:** <https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653>\
**Category:** Windows\
**Created:** [February 20, 2022, 5:09pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653 "2022-02-20T17:09:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 20, 2022, 5:09pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/1 "2022-02-20T17:09:29Z")

</div>

Im confused by a Windows benchmark.  
One customer reports that my app runs very slowly on a gaming machine that SHOULD be blisteringly fast.  
(3.7Ghz, 16Gb memory, Radeon card etc etc)

Much slower than my 7 year old, 4gb Dell laptop for example.

yet processor and Ram usage don’t look silly.  
This is my app on the top row, Chrome underneath.

What would cause ‘very high’ power use?

 ![image](https://forum.xojo.com/uploads/default/original/2X/c/c23cfa10254468da94a78cdfc3e40aa7d60f225d.png)

---

<div class="post-metadata">

**Author:** ![Andreas\_Reichmann](https://forum.xojo.com/user_avatar/forum.xojo.com/andreas_reichmann/32/1435_2.png) [@Andreas\_Reichmann](https://forum.xojo.com/u/Andreas_Reichmann)\
**Post date:** [February 20, 2022, 5:51pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/2 "2022-02-20T17:51:36Z")

</div>

High Power Usage only means that a process uses a lot of CPU power.

A CPU core on high utilization = high clock frequency (possibly turbo clock) needs a lot of energy.

Please do not be confused by the 6.4% Cpu load. Xojo uses only one thread (if no workers are used, and that would be extra processes). I.e. with an 8 core CPU (Under Windows with HT then 16 available cores) would be 6.25% full load for a core. (Of course assuming it is an 8 core CPU). 100% / 16 Cores.

So your app is running with 100% CPU (if it is a 8 Core cpu)

For a further diagnosis you would need more data and background information about the system and your program. Bottleneck can also be e.g. the disk access. Here is in the Windows performance \<monitor possibly more to see.

First of all I would check if a virus scanner is the cause or the brake. This is currently a common problem which leads to such effects.

Translated with [www.DeepL.com/Translator](http://www.DeepL.com/Translator) (free version)

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [February 20, 2022, 5:55pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/3 "2022-02-20T17:55:54Z")

</div>

Andreas is right, 6.25% is likely 100% of a single CPU thread.

On macOS you could use the Sample Process command from Activity monitor and see exactly what’s using CPU (or the even better Instruments.app).

Is there a similar way to get a performance / sample stack trace on Windows?

---

<div class="post-metadata">

**Author:** ![Andreas\_Reichmann](https://forum.xojo.com/user_avatar/forum.xojo.com/andreas_reichmann/32/1435_2.png) [@Andreas\_Reichmann](https://forum.xojo.com/u/Andreas_Reichmann)\
**Post date:** [February 20, 2022, 5:57pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/4 "2022-02-20T17:57:15Z")

</div>

Windows Performance Monitor is the tool ;-). But first of all I would disable (for testing) all Virus Scanners and Malware Checkers. (7 out of 10 support tickets last weeks where because of virus scanners going crazy).

> **[Windows Performance Monitor Overview](https://techcommunity.microsoft.com/t5/ask-the-performance-team/windows-performance-monitor-overview/ba-p/375481)**
>
> First published on TECHNET on Jul 17, 2014 Hello AskPerf!  My name is Matt Graham and I will be writing a high level overview of the capabilities of Windows Performance Monitor.  The intention of this blog post is to introduce new users...

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [February 20, 2022, 6:03pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/5 "2022-02-20T18:03:14Z")

</div>

Does WPM actually provide symbolicated stack traces with timing info? Perhaps it does, but I’m not seeing any examples demonstrating it.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [February 20, 2022, 7:51pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/6 "2022-02-20T19:51:03Z")

</div>

A tight loop would certainly do what is described.

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 20, 2022, 8:04pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/7 "2022-02-20T20:04:11Z")

</div>

> [@Michel\_Bujardet](#):
>
> A tight loop

Xojo doesnt have any other kind.

---

<div class="post-metadata">

**Author:** ![DerkJ](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DerkJ](https://forum.xojo.com/u/DerkJ)\
**Post date:** [February 20, 2022, 8:06pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/8 "2022-02-20T20:06:12Z")

</div>

🕶

```auto
For i As integer = 0 To 0
// i'm not that tight 
Next i

```

---

<div class="post-metadata">

**Author:** ![DerkJ](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DerkJ](https://forum.xojo.com/u/DerkJ)\
**Post date:** [February 20, 2022, 8:07pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/9 "2022-02-20T20:07:17Z")

</div>

What’s the second tab showing you in the task manager? any of the cpu’s at 100% ?  
I think this happens if you choke the main thread too much, try to lower the priority of threads to 4 on windows (or lower).

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 20, 2022, 8:10pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/10 "2022-02-20T20:10:25Z")

</div>

> [@DerkJ](#):
>
> try to lower the priority of threads to 4

You mean right click and set to a lower priority?  
Wouldnt that just slow my app down further, though?

---

<div class="post-metadata">

**Author:** ![DerkJ](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DerkJ](https://forum.xojo.com/u/DerkJ)\
**Post date:** [February 20, 2022, 8:11pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/11 "2022-02-20T20:11:51Z")

</div>

No the Thread.Priority you have too much thread time slice being used, too less time for the main thread i think.

On Windows if you have a thread with Thread.Priority = 5 (same as main thread) you may choke windows. Just try to lower it a little.

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [February 20, 2022, 8:19pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/12 "2022-02-20T20:19:47Z")

</div>

What does the app do?

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 20, 2022, 8:29pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/13 "2022-02-20T20:29:06Z")

</div>

> [@DerkJ](#):
>
> On Windows if you have a thread with Thread.Priority = 5

Is this a setting I can amend in Xojo?

---

<div class="post-metadata">

**Author:** ![DerkJ](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DerkJ](https://forum.xojo.com/u/DerkJ)\
**Post date:** [February 20, 2022, 9:08pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/14 "2022-02-20T21:08:44Z")

</div>

Only on threads you create in code. If you don’t have threads you may have loop method(s) that have  
`#Pragma BackgroundTasks False` ?

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [February 20, 2022, 9:23pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/15 "2022-02-20T21:23:32Z")

</div>

If you can’t reproduce the issue perhaps others can. Is this an app the public can download?

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 20, 2022, 11:07pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/16 "2022-02-20T23:07:29Z")

</div>

> [@Mike\_D](#):
>
> Is this an app the public can download?

It is, but this issue only seems to affect 1 in a 100 or less.  
Commonly high end machines.  
Other symptoms I have established include failure to write to simple log files in documents or application support.  
To me, this is a clear case of virus checker interference, but the (current) customer swears that only Windows defender is in play and turning it off makes no difference.

I thought that the intense part of the app was already in a thread, but checking my code I see I pulled back from that at some point, and it is all still on the main thread. I dont use #pragmas at the moment

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [February 20, 2022, 11:09pm UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/17 "2022-02-20T23:09:40Z")

</div>

If indeed your app has a tight loop that takes too much CPU, you may want to move it to a thread.

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [February 21, 2022, 12:22am UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/18 "2022-02-21T00:22:40Z")

</div>

> [@Jeff\_Tullin](#):
>
> It is, but this issue only seems to affect 1 in a 100 or less.

Yeah, that sucks. I feel for you. I have an app which works great 99% of the time, but those 1%…

Send me a PM and I’d be happy to test against a few machines if you’d like.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [February 21, 2022, 10:18am UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/19 "2022-02-21T10:18:24Z")

</div>

For threads, you can always put in a sleep(10) to sleep 10 ms after each run and that will reduce the CPU load.

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [February 21, 2022, 10:30am UTC](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653/20 "2022-02-21T10:30:58Z")

</div>

sleep(10) _after_ each run?  
Wouldn’t that pause the app again, making the use of a thread a bit redundant?

[Next page](https://forum.xojo.com/t/what-would-cause-windows-to-report-high-power-use/68653.md?page=2)
