AHKhttp
AHKhttp copied to clipboard
Crashes after a while (memory leak?)
Hi,
There's a memory leak somewhere, even when using the example scripts.
After receiving some amount of requests (1000? 2000?) it will crash.
I am not sure if the problem is in AhkHttp.ahk or AhkSock.ahk.
I guess maybe an object or array is not cleared somewhere? I have had a look but couldn't find anything.
Has anyone any idea please?
Thanks.
too many new() in AHKhttp.ahk.
I have the same problem. My script crashes after 1270 - 1290 requests. And I'm not smart enough to solve this, so please help.... ;-(
Kindly Aki
Has anyone any idea please?
You could try downloading and running the initial commit version https://github.com/zhamlin/AHKhttp/tree/65de0446156ccc4b2a3ed15e7f39d325ba6850db
I believe that when support for binary files was added, a Stack Overflow error was introduced.
Yes.... Thanks!!!
I got it working....
Thank you again rtayne
Yeah, the new Buffer class is definitely where the issue is. I've run a few tests and it always fails between 1,000 and 2,000 requests. I end up getting a "Function recursion limit exceeded" error at line 354 (attached). I'll dig into this myself, but this is a bit beyond my current level in AHK. Any ideas on how to deal with this? Reverting back to the initial commit seems to cause other issues.
After hunting for a while, found this on the forums that patches the leak - https://www.autohotkey.com/boards/viewtopic.php?t=4890&start=40
In case something happens to the post, attached is the patched and zipped AHKhttp.ahk (full credit to magusneo. I'll put in a pull request with this, but seeing how there have been no responses for quite a while, the updated *.ahk is here.
Note: I've also updated it with the pull request by @bjc5233 to fix the linefeed and variable name bugs. I've also stress tested up to 10K calls and it seemed to be stable vs cashing after less than 2K calls.
After hunting for a while, found this on the forums that patches the leak - https://www.autohotkey.com/boards/viewtopic.php?t=4890&start=40
In case something happens to the post, attached is the patched and zipped AHKhttp.ahk (full credit to magusneo. I'll put in a pull request with this, but seeing how there have been no responses for quite a while, the updated *.ahk is here.
Note: I've also updated it with the pull request by @bjc5233 to fix the linefeed and variable name bugs. I've also stress tested up to 10K calls and it seemed to be stable vs cashing after less than 2K calls.
At the post, you said it didnt worked afterall? https://www.autohotkey.com/boards/viewtopic.php?p=410391#p410391