

It makes me think, probably, the memory leak that I'm experiencing is caused by the length of the results (texts) that are different from each new window. Now, I set the handle for active window (WingetHandle("")) and the leak is back. It started at 3,952k then after I opened some windows it became 3,964kb and it stays stable at that. Now, I remove the 'WindowFromPoint' and set the handle at 0 for the 'GetWindowText' to get the text. With just 'WindowFromPoint' the usage is stable at 3,924k.

And, after I wrote this reply, now it is at 4,280k. After opening new programs (Notepad, Regedit, Firefox, MsPaint, Onscreen Keyboard, control panels applets, etc.) and closing their windows, the script used RAM at 4,248k. Now it doesn't always take RAM immediately after new window shows up. I don't know if this is just my feeling or not.but it seems the leak is getting a bit smaller. However, I doubt this is the case tho, or is it? Hmm.as a matter of fact, on the PC that I'm using, I use the 'Self Extracting Archive' version of Autoit, the one that I don't have to install (I try to reduce information being add to the system). No Autoit was running on different PC, I was just running the compiled version of the above code. The different PC was running WIN XP SP2 the same with what I'm using.ģ. I verify RAM usage by using TaskManager, the 'Mem Usage' column.Ģ.


Now, the leak is gone if I take out 'GetWindowText', so the script only calls 'WindowFromPoint'.Ĭan someone please tell me this is a memory leak or not, and how to make the memory stable? However, slowly it will become less aggressive when no new window appears, but it still eats a bit here and there. In the test on my PC, the script would take around 4-16kb if a new window appears. $FPointWinTitle=DllCall("user32.dll", "int", "GetWindowText", "hwnd", $hPoint, "str", "", "int", 32768)Īs you can see, it mostly does dllcalls on user32 'WindowFromPoint' and 'GetWindowText'. $hPoint = DllCall("User32.dll", "hwnd", "WindowFromPoint", "int", $Mpos, "int", $Mpos) I have a simple function, but somehow it keeps eating RAM little by little. So, I'm sorry if this has been answered before. I had been searching and reading the forum about memory leak, but couldn't find anything related.
