It was a stress test. I expected it to work because it works in any modern browser.
The problem wasn't high cpu usage or the renderer process being locked up, it was crashing almost instantly because of an out of memory exception (with less than 40MB ram allocated). That shouldn't happen.
This was confirmed to be due to the usage of CefRegisterExtension, as I wrote in my last post:
Devyre wrote:I should have listened to you when you told me not to use extensions.
This issue is because of extensions, 100% confirmed.
I just added my NativeCall to the window object instead of registering an extension, and the exact same code, even the first one, now works perfectly fine.
It also seems to execute significantly faster than extensions.
Memory usage no longer increases to infinity, unless I use the first snippet (the tight while true loop).
But in that case, the JavaScript GC does its job and collects the garbage once I reach about 28MB ram.