[DEPRECATED] How-to: decreasing UI memory usage on Windows / Linux

Discussion in 'Support!' started by SXX, August 19, 2014.

  1. admrialmardok

    admrialmardok New Member

    Messages:
    10
    Likes Received:
    2
    I've uploaded the zip for you.
    all I did was copied the code lines at the top of the thread into a .txt and renamed it a .reg file
    in regards to the 32\64 bit issues, I have host files in both the bin_x64 and bin_x86 folders
    i also tried creating a new registry entry, and then running the reg file, but it still complained
    thanks for helping

    Attached Files:

  2. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    You mist two first lines of .reg file. E.g you need to put "Windows Registry Editor Version 5.00" and one new line before "[HKEY_LOCAL_MACHIN..." part. ;)
    spittoon likes this.
  3. admrialmardok

    admrialmardok New Member

    Messages:
    10
    Likes Received:
    2
    i feel like an idiot for missing that. it did the trick, thanks.
    unfortunately, i still cant play the galactic war, it eats up too much memory. but i can quit the game without crashing.
    thanks for helping
    shootall likes this.
  4. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    You can as well run PA with "--software-ui" that going to save extra 300MB RAM, but it's looks like you're just extremely low on memory so it's not likely going to help you.
    shootall likes this.
  5. vakwateni

    vakwateni New Member

    Messages:
    4
    Likes Received:
    0
    I tried it but when i try and launch the game with the PA launcher it says "please shut down all instances of PA and try again"

    i have 8g ram

    Attached Files:

  6. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    I doubt it's related to UI configuration modification. :(
  7. vakwateni

    vakwateni New Member

    Messages:
    4
    Likes Received:
    0
    I think it is, when i merge coherent with the registry the game wont launch with the PA launcher, when i restore it, it does launch, when i merge it and launch with PA.exe in the x64 folder the game starts but i have more than 5 process running in task manager.

    But here is my dxdiag maybe there is something im missing

    Attached Files:

  8. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    2gigs of memory for a UI ???????????? seriously, such a middleware is just a joke ....WTF is this middleware storing in data structures ??????
  9. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    It's Google Chrome so memory usage is totally same as in actual browser. It's designed to execute potentially malicious code and security have it's own cost.

    Though Coherent developers make it use separate renderer thread for each "view" (panel in UI in case of PA) so in case of PA it's spawn too much of those threads and it's something Uber want to change likely.

    Also memory usage on Linux is quite higher because Coherent is 64-bit there while on Windows both 32-bit and 64-bit versions of PA using 32-bit Coherent.
  10. doud

    doud Well-Known Member

    Messages:
    922
    Likes Received:
    568
    OK why not, but i've never seen chrome using that much memory on my system even with lots of instances. I mean even if multiple processes are involved there are shared libraries no ?
  11. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    First of all are you talking about Windows or Linux? On Windows memory usage of UI isn't about 1.6GB with 32 "views / pages" open. Also on Linux I use 64-bit Chrome for long time and it's can easily eat 2.5GB of RAM with 20 tabs open and some twitter account with scrolling easily add 300-350MB.

    It's quite a lot compared to Google Chrome, but only because chrome have different policy to split load between renderers so it's usually spawn less of them. I suppose reason for having one renderer per view by default is simple: web browser don't need to rapidly render every tab you have opened 60 times per second because you likely only use 1-2 tabs simultaneously and on most of websites you really won't notice difference between 15FPS and 150FPS except if you watch video. For game situation is different: every UI element (web page) have to be rendered instantly with higher possible FPS so they changed this part of Chromium.

    Though in PA you only limited number of all "panel / views" is visible in same time so it's not needed to keep dedicated process for each of 32 panels.

    As far as I understand Chromium security model based on fact that each renderer process can't actually display anything on it's own, heavily sandboxed and talk to "overlord" and "GPU" processes over IPC. So each renderer memory likely include own copy of HTML engine (WebKit/Blink), own JavaScript runtime (V8), software renderer, etc, etc.

    Chrome does use shared libraries on Linux, but it's own codebase likely a lot larger than size of all shared libraries it's use.
    shootall and doud like this.
  12. kjotak109

    kjotak109 Well-Known Member

    Messages:
    606
    Likes Received:
    303
    Wait, why on Windows does PA use 32-bit Coherent UI?

    If 32-bit Coherent UI were used for 64-bit PA, won't that trigger 2GB crashes with the UI, as the UI_Host is 32-bit?
  13. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Because Chrome didn't support 64-bit builds on Windows till Chrome 37 that was released day ago, but on Linux it's was native 64-bit since 2009. Though current Coherent game using is likely based on Chromium 28 or 29.

    Nope for few reasons:
    • 2GB limitation only affect 32-bit OS in general.
    • On 64-bit OS it's affect 32-bit executables that don't have "Large Address Aware" option enabled
      Chrome does have it's enabled.
    • Multi-process architecture it's main reason why Chrome don't need to have 64-bit on Windows.
      It's nearly impossible that one browser tab going to use 2GB except there is some serious memory leak.
    And yeah Firefox on Windows is 32-bit even if not being multi-process.
    Last edited: August 27, 2014
    shootall, kjotak109 and doud like this.
  14. flipstone

    flipstone New Member

    Messages:
    4
    Likes Received:
    1
    I was googling this error, which has been plaguing me as of late, and I came across this thread. However, when I attempted to use the Windows fix at the top, PA registered the 'could not load CoherentUI error'. In my stupidity, I then attempted to overwrite this fix with the one detailed by a2razor below, to no avail. Now, even after a reinstall PA doesn't work. Could anyone be so kind as to help me untangle my own mess?
  15. fajitas23

    fajitas23 Member

    Messages:
    32
    Likes Received:
    4
    Has anyone tested this with the new PTE?
  16. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    1. Press Win+R to invoke "Run" window.
    2. Now put "regedit" here.
    3. Now navigate to this item:
      Code:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\
    4. Remove sub-item called "CoherentUI_Host.exe".
    Now it's will back to normal.
  17. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    There was no serious changes in how UI work compared to stable version so it's will work.
  18. fajitas23

    fajitas23 Member

    Messages:
    32
    Likes Received:
    4
    Thanks a lot. I tested (all you have to do is replace 'stable' with 'PTE' in the path with the double //) with 5 CoherentUI and the game was playable on my 4GB machine for the first time in weeks. The reported usage was between 3.6 GB and 3.7 GB on the 'Annihilator System' and as a result, the hard disk was seldom used. I will test with less than 5 CoherentUI instances and report back.

    edit: Reduced to three threads but no obvious difference in RAM usage. Setting the resolution down to 50% seems to reduce a few hundred MB, though.
    Last edited: August 29, 2014
  19. Brokenshakles

    Brokenshakles Active Member

    Messages:
    239
    Likes Received:
    143
    Really? Who thought that using middleware that uses this sort of model would be a good idea for a video game? It's not like video games are resource intensive already, especially in the area of ram... So we are reloading all of the UI support libs for each object we have on screen? All so that the UI can be coded in HTML5, and have a security model fit for a banking website? Who in the heck thought this was a good idea? Closed source to boot! So there is no way to fix the current problems its causing us directly! We have no less than 3 fantastic middleware suites on Linux (QT, GTK, EFL) that also work on Windows and they chose this? All just for HTML5? Ug. The internal UI of a game does not require the sort of security featured here, presumably its spawning process and threads can be trusted to create UI widgets from a standard shared lib assets loaded once in ram. No need for complicated and expensive sandboxing.
    Last edited: August 29, 2014
    fajitas23 likes this.
  20. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Are you sure you checking total (NOT PA.exe) in-game (not in menus) RAM usage?

    Basically game only spawn new CoherentUI_Host.exe processes when you join actual game and each process eat at least 30MB which gives about 1GB in total, plus there is managing thread (might use few hundred MBs) and GPU process (250-350MB).

Share This Page