Opened 11 years ago

Closed 10 years ago

#2284 closed Bug (Rejected)

InetClose() always returns false, repeated Inetget() causes high memory usage

Reported by: garbb Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: InetGet InetClose Cc:


The help file says that InetClose() will return true if the handle was found and closed, but no matter what I tried I could not get it to return true, it will always return false. Try the test code right from the InetClose() part of the help file with one modification to output the return from InetClose() to the console:

Local $hDownload = InetGet("", @TempDir & "\update.dat", 1, 1)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
consolewrite(InetClose($hDownload)&@CRLF) ; Close the handle to release resources.
MsgBox(0, "", "Bytes read: " & $nBytes)

It will always return false.
Another thing that seemed weird is that the help file says that InetGet() with the background parameter set to 1 will return a handle but if you output it to the console you get '1'. In my experience with autoit when you try to display a handle in the console you will get either a hex number or a blank string, so maybe the issue is that InetGet() is not really returning a handle correctly?

As for the memory usage:
I ran a script that used InetGet() (and InetClose() to close the handles) to download a large number of files and after a few hours of running, the windows 'Superfetch' service and/or the 'Program Compatibility Assistant Service' had increased their memory usage to several hundred megabytes and the computer became unresponsive. Also, either the 'Program Compatibility Assistant Service' or the 'application experience' services had very high CPU usage. To test, goto the services tab of windows task manager and right click on the Superfetch service (listed as name='SysMain') and 'Program Compatibility Assistant Service' (listed as name='pcasvcs') and click 'Go to Process' and then watch those process's memory usage after hours of running the script below. (on the computers I have looked at the Superfetch and Program Compatibility Assistant Service were both using the same process.)
Using the information here: I was able to see what particular services were using up all the memory but you do not actually need to do this unless you are curious.

Here is my testing script for this. To get the results I got you will need to leave it running for many hours:
I used my own local webserver which I got here: so I wouldn't hammer some website for this, but you could use any address.

while true
Local $hDownload = InetGet("", @TempDir & "\update.dat", 1, 1)
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
InetClose($hDownload) ; Close the handle to release resources.

I tried using InetRead() instead of InetGet() and it appears to have the same problem.
I also tried this with the beta and found the same issues.
I tried changing the 'automatically detect settings' in the connection settings of internet settings because of this: bug, but it didn't seem to change the results.
I should have probably mentioned that this is all running on windows 7.

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Jon

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.