Thank you for your detailed answer, lexikos.
I got the part about how I don't need to do anything other than releasing my reference to the object with simple
Obj := "".
Probably, this does indeed result into the unallocation of the ahk's ComObject wrapper and maybe even in unallocation of the referenced COM object in the system and the amount of consumed memory remains on high level only because the dependent libraries that got loaded - don't get unallocated as well.
I've tried DllCalling "FreeLibrary" to free up ieframe.dll and mshtml.dll - and that does in deed free up extra 30MB.
As for memory consumption concerns - of course that's not critical for my system where I have lots of available RAM, yet still I'd like to find a way to clean things up, because:
1. Starting ahk script: ~8MB.
2. Doing
Code: Select all
Gui, Add, ActiveX, vObj hwndObjHWND, about:<!doctype html><meta http-equiv="X-UA-Compatible" content="IE=Edge">
Obj.Document.Open()
Obj.Document.Write("<html><body><a href=""http://imdb.com/"">imdb</a></html>")
Obj.Document.Close()
Gui, show
~29MB.
3. Clicking on the link: ~137-140MB.
4. Calling
~96-115MB.
The end result is 12-14 times more than the amount of allocated memory at script's start.
Plus, as you can see just loading a simple html takes a pretty okay amount of memory, it's loading sites is what adds up most.
Maybe closing the site, destroying the gui and releasing the reference to the object still leaves some cache behind, maybe you know what I should do to reduce the memory consumption in the above mentioned scenario?