Adobe-Runtime-Support
Adobe-Runtime-Support copied to clipboard
URL Loader: Crash when doing too many concurrent requests
Problem Description
I recently noticed that AIR is crashing when performing too many URL Requests at the same time on Windows (at least).
From a developer stand point I would prefer facing an Error rather than a crash.
Steps to Reproduce
The following snippet will make the app freeze when interacting with it (e.g.: resizing the main window) and then crash:
for (var i:int = 0; i < 500; ++i)
{
var request:URLRequest = new URLRequest("https://sfdgdfgsdfsdgfgfsd.com");
request.method = URLRequestMethod.GET;
var loader:URLLoader = new URLLoader();
loader.load(request);
}
This is 100% reproducible at my end.
Known Workarounds
Limit the number of concurrent requests by implementing a counter.
Which version of Windows are you using? And how are you launching it, can you reproduce it when running from ADL? Trying it here and we get the "unhandled ioError" event which pops up as we're running from ADL. Adding the "-nodebug" command and those messages no longer pop up but we still don't see it freeze or crash...
adl32 on my machine: [Fault] exception, information=Error: Error #1000: The system is out of memory.
not necessarily relevant, but you can refer to:
my video call application usually crashes when the memory reaches about 600MB and prompts (The system is out of memory.) so I wrote an ANE to call "EmptyWorkingSet", but it didn't work. I can only split multiple processes to keep it stable
Here my application crash with out of memory at around 1.4 gb, weird values.
Hi Andrew,
Thanks for having tried to reproduce it. Here are few answers to your questions:
Which version of Windows are you using?
I can reproduce it on Windows 10 (on two different machines) and Windows 11 as well. I'm using AIR 50.2.5.1.
And how are you launching it, can you reproduce it when running from ADL?
Yes, in all cases I'm launching it with adl (32-bit) via the ActionScript & MXML language extension for Visual Studio Code. I actually don't know how to test this with adl64.exe (setting <architecture>64</architecture> in the application.xml doesn't automatically use it - I will have to check that with Josh)
Trying it here and we get the "unhandled ioError" event which pops up as we're running from ADL. Adding the "-nodebug" command and those messages no longer pop up but we still don't see it freeze or crash...
Good to see that it's actually the intended behavior. On my side the AIR SDK Manager don't catch anything... How can I give you more details about the crash?
In case it can help, here is a small project to attempt to reproduce it: https://github.com/Adolio/AIR-URL-Request-Crash
Best, Aurélien