COM object CPU leak in Win 10 Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
pneumatic
Posts: 288
Joined: 05 Dec 2016, 01:51

COM object CPU leak in Win 10

11 Jul 2019, 20:39

This only occurs on my Windows 10 install (v1903 May 2019). Windows 7 appears unaffected.

Code is from https://www.autohotkey.com/docs/commands/URLDownloadToFile.htm

(it just downloads the current version number of ahk from https://autohotkey.com/download/1.1/version.txt)

Code: Select all

#Persistent
return

^1::  ;Ctrl+1
req := ComObjCreate("Msxml2.XMLHTTP")
	; also try Msxml2.XMLHTTP.3.0 , Msxml2.XMLHTTP.6.0 , Msxml2.ServerXMLHTTP
	; Msxml2.ServerXMLHTTP.3.0 , Msxml2.ServerXMLHTTP.6.0 , Microsoft.XMLHTTP 
req.open("GET", "https://autohotkey.com/download/1.1/version.txt", true)
req.onreadystatechange := Func("Ready")
req.send()
return


Ready(){
global req
    
	if (req.readyState != 4)  ; Not done yet.
		return
	if (req.status == 200) ; OK.
		MsgBox % "Latest AutoHotkey version: " req.responseText
	else
		MsgBox 16,, % "Status " req.status
	
	req.abort()  
	req := ""
}
When the script is launched, CPU usage is zero as it should be:

Image

Press Ctrl+1 to download the file

Image

Download complete, but now CPU usage is pegged at 0.02

Image

It seems that some thread belonging to the COM object must still be alive and needs to be released or closed the right way?

I've tried disconnecting the ComObj from events with ComObjConnect() and releasing its interface pointer with ObjRelease() (after getting it with ComObjType() and ComObjQuery() ).
swagfag
Posts: 3084
Joined: 11 Jan 2017, 17:59

Re: COM object CPU leak in Win 10  Topic is solved

12 Jul 2019, 06:14

its not doing it on my computer
Spoiler
the only time cpu time is consumed is (1) when the script is first launched, (2) when the xmlhttprequest is made, (3) when msgboxes show up and when u interact with them(move, mouseover, destroy)
pneumatic
Posts: 288
Joined: 05 Dec 2016, 01:51

Re: COM object CPU leak in Win 10

12 Jul 2019, 06:42

Thanks.

I guess it must be something about my system configuration causing it. I will try a fresh install of Windows.
pneumatic
Posts: 288
Joined: 05 Dec 2016, 01:51

Re: COM object CPU leak in Win 10

12 Jul 2019, 20:42

Found the culprit, it was the motherboard's ethernet controller driver ("Killer E2200 Gigabit Ethernet Controller"). Motherboard is an Asrock Z97X Killer. I already knew that Killer ethernet software was dodgy as its "bandwidth control" feature was randomly turning itself on and throttling my network traffic to a few mbps.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], thephoenix and 225 guests