Browser won't refresh it's image when you have low amount of RAM left
Describe the bug When you have 90% usage of RAM your browser will look like it's frozen. It will return events from JS to MTA etc. but you will see only one frozen frame, isBrowserRenderingPaused will return false. You can use resizeBrowser to "refresh" the screen (and you will see artifacts), it should work everytime.
To reproduce
- create VM with low amount of RAM
- turn on your local browser with JS scripts
- do something in it
- it will definitely freeze
Video https://youtu.be/8yeEhYHERWo
Version 1.5.6 - 1.5.9
So you're saying that by not giving CEF enough resources to function correctly, it won't be able to function correctly?
Your first step also mentions a VM - there could be countless other reasons why a VM is interfering here and could be nothing to do with MTA or CEF.
Also - please provide a resource which can be used for reproduction in these "low RAM" scenarios.
I'm saying that if you resize it, the CEF starts working properly. Since it lacks resources, it should not work at all and not just show the image incorrectly. It should be consistent, right?
It has nothing to do with the virtual machine, players on my friend's server have the same problem. After I added resizeBrowser before loading JS script, their resource started working properly despite of 2 GB RAM,
Resource: Desktop.zip
- /start browser
- /start browseraddon
- wait ~5 sec for browser to load the default index blank page
- click Q to open/close it
- it will bug after 2-10 clicks
- type /fix to reload the browser size and it's image
- now its working again, yay
I thought in #699 that page wouldn't load but it did, I just didn't see it on the screen. Sometimes it won't load on PC's with 16 GB RAM but I don't know what the memory usage was at that point.
GTA:SA recommended is Memory: 4GB of RAM or more Don't expect modded version to work with less...
It can happen when player has 8 GB RAM, multiple applications in the background and browser will freeze when you use it at that time. As a server owner you have to handle that situations without knowing that browser could do that. Browser will return events as it should, but you can't see what's in the browser - you only see frozen frame. 2 GB RAM is a situation when it's happening everytime. You even can't check if it's rendered image is frozen. You have to assume that's not working and resize browser for fixing it lol? Am I doing something wrong in my resource or you can't do things like HTML login panel or use it for UI because it can break at any time?
Also, remember, as MTA is 32 bits it can't use more than 4 GB of RAM, no matter if the user has 8 or 64. (Although, it is beneficial for the user to have more than 4, as in that case other applications will have more to spare)
Yup, MTA is using like 1,4 GB of RAM and CEF is using ~50 MB max. It isn't 32 bit limit.
GTA:SA recommended is Memory: 4GB of RAM or more
No it's not, stop spreading this misinformation. GTA:SA recommends 384 MB, and MTA:SA recommends 2GB: https://wiki.multitheftauto.com/wiki/Client_Manual#System_requirements
Yes, the issue has nothing to do with 32-bit or 64-bit at all, since CEF runs in an extra process, it doesn't affect MTA's memory ceiling much.
@MrDadosz Did the VM's OS or the player's OS have enough virtual memory available? You can look by opening the Resource Monitor in Windows, and looking at the commit charge on the right. Ignore physical memory, in a perfect world, it shouldn't matter.
- If there is almost no virtual memory available: It's a fault on the player's side, no more memory can be allocated, so the browser crashes. Add more virtual memory in the Advanced system settings.
- If there is virtual memory available: This is an issue.
You might be able to check if the browser is still alive by using injectBrowserMouseMove, it apparently returns false if it wasn't successful, which might happen if the browser is dead. resizeBrowser can also return false.
GTA:SA recommended is Memory: 4GB of RAM or more
No it's not, stop spreading this misinformation. GTA:SA recommends 384 MB, and MTA:SA recommends 2GB: https://wiki.multitheftauto.com/wiki/Client_Manual#System_requirements
Yes, the issue has nothing to do with 32-bit or 64-bit at all, since CEF runs in an extra process, it doesn't affect MTA's memory ceiling much.
@MrDadosz Did the VM's OS or the player's OS have enough virtual memory available? You can look by opening the Resource Monitor in Windows, and looking at the commit charge on the right. Ignore physical memory, in a perfect world, it shouldn't matter.
- If there is almost no virtual memory available: It's a fault on the player's side, no more memory can be allocated, so the browser crashes. Add more virtual memory in the Advanced system settings.
- If there is virtual memory available: This is an issue.
You might be able to check if the browser is still alive by using injectBrowserMouseMove, it apparently returns false if it wasn't successful, which might happen if the browser is dead. resizeBrowser can also return false.
384 MB is for Windows XP, we dropped suport for this. For windows Vista(we dropped support for Vista too, now minimum is Windows 7)+ Recommended is 4GB (It is because Vista is 1GB+, so 384 MB recommended for any program would be too little.)
Like I said previously - it can happen even when you have more RAM left. Simply browser is freezing and it's showing last rendered frame. You can use resizeBrowser to fix it for a while, but it will do it again and after that you have to reset your MTA to make it working again. With VM and with low RAM you can freeze it almost everytime. Browser isn't crashing, you can use JS and do everything but you can't see what's happening on screen. Functions like resizeBrowser returns values, injectBrowserMouseMove too.