It is currently January 30th, 2023, 6:40 pm

One easy fix for 100% CPU on XP systems

Tips and Tricks from the Rainmeter Community
User avatar
karmat
Posts: 329
Joined: July 7th, 2009, 11:10 pm
Location: Canada

One easy fix for 100% CPU on XP systems

Post by karmat »

I could slap myself on the forehead for all the time I spent today trying to figure out why my CPU usage was staying at 100% on this new skin I downloaded... http://taipan-snake.deviantart.com/art/Homescreen-Rainmeter-Final-133512086. I had a couple of earlier versions of it - one was fine, one had CPU problems.

The reason I'm posting this is because it was such an easy fix, but I didn't figure it out till the very end so maybe I can save someone else the headache!!! I'm on XP SP3, 1.1-181 rainmeter version.


This rainmeter has a bunch of tabs and various components on each one so its a fairly long file. I compared the ini file with the older version that I knew worked okay and then left the components alone that I knew were okay.

Then I started deleting one component at a time till I finally found the culprit. It was the Recycle Bin, after deleting all the code for it, my CPU usage was normal. Then the lightbulb finally went off in my brain and I checked out how much junk was sitting in the trash bin. I emptied it, put the code back in, and all is right with the world once again!
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: One easy fix for 100% CPU on XP systems

Post by dragonmage »

Yes, there is an issue with the RecycleManager when large numbers of files are in the bin. Gschoppe has been notified and I believe he is looking into the matter.
User avatar
gschoppe
Developer
Posts: 93
Joined: April 26th, 2009, 8:30 pm
Location: St Johnsbury, VT

Re: One easy fix for 100% CPU on XP systems

Post by gschoppe »

I am currently investigating the issue... it appears to be a failure on the part of microsoft's API.

The shQueryRecycleBin command appears to enumerate each file when called, getting info on each, rather than enumerating such info when the files are recycled, and just calling a stored variable...

---
THIS IS RIDICULOUSLY BAD CODING by microsoft...
---

I believe the info is stored somewhere as a variable, but so far, every mention i've seen of recycle bin monitoring has used shQueryRecycleBin ... I know rocket dock doesn't work this way, for example, but I'm not yet certain how it does work... I'll know more once I've had some more investigation time.
Image
User avatar
karmat
Posts: 329
Joined: July 7th, 2009, 11:10 pm
Location: Canada

Re: One easy fix for 100% CPU on XP systems

Post by karmat »

Thanks you two, good to know there's a reason for it, thought it was just my lack of knowledge!
User avatar
taipan_snake
Posts: 18
Joined: July 29th, 2009, 7:14 am
Location: Sydney, Australia

Re: One easy fix for 100% CPU on XP systems

Post by taipan_snake »

Thanks for pointing this issue out, but judging from other comments, i can't do anything about it:(
User avatar
jsmorley
Developer
Posts: 22558
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: One easy fix for 100% CPU on XP systems

Post by jsmorley »

gschoppe wrote:I am currently investigating the issue... it appears to be a failure on the part of microsoft's API.

The shQueryRecycleBin command appears to enumerate each file when called, getting info on each, rather than enumerating such info when the files are recycled, and just calling a stored variable...

---
THIS IS RIDICULOUSLY BAD CODING by microsoft...
---

I believe the info is stored somewhere as a variable, but so far, every mention i've seen of recycle bin monitoring has used shQueryRecycleBin ... I know rocket dock doesn't work this way, for example, but I'm not yet certain how it does work... I'll know more once I've had some more investigation time.
We were discussing this problem on IRC the other night, and wonder if you could look into a solution, at least for the short term where we could have a new parameter in addition to COUNT and SIZE. All I want, and I suspect many if not most folks want, it a way to know that the recycle bin is "full". I could care less how many or how big. I just want to have a way to know to display either a "full" or "empty" icon so I can right click it to empty it.

If you had a new parm called "STATE" or "STATUS" or something that just did a FindFirstFile on the recycle bin folder(s) and returned 0 or 1, that would meet many folk's needs while using effectively zero CPU. Those who want to display a count or size can still do that, with the understanding that when the bin is really full with a lot of files and folders it is going to have to work pretty hard given the state of the API.