Menu

#2516 Memory utilization never decreases.

None
NeedInfo
nobody
Medium
2021-01-16
2021-01-12
Megaf
No

Hi all.
So, I'm doing a high altitude long haul as I type this. The objective of this flight is to monitor CPU and memory utilization as scenery loads and unloads and as weather changes. Also, to see how memory behaves when switching from region specific to global DDS.

On this flight (And on previous flights as well) I could observe the following.
FG Settings for the test

  • Pylons, Scene Models, Roads and all Objects and Models are disabled.
  • ALS, Shaders (Generic, Model, Shadows) All switched off.
    Conclusion
  • BAD - Although it doesn't happen all the time, sometimes memory does leak, and start leaking quick, minutes after launching the sim, settings and location don't seem to affect much, that said, it does seem to happen more often over Europe.
  • GOOD CPU use on itself remained low throughout the flight, remaining steady at around 40% of total CPU, ~20% per core on 2 cores.
  • UGLY Memory is NEVER freed. When switching from Region-Specific to Global DDS, old textures and terrain seems to remain loaded, at the insane huge LOD (Max detailed, max rough, max bare) and insane view distance (Many million miles) I'd expect the memory use, to drop drastically, but in face, it just increased. When switching from Basic Weather to Advanced Weather, more memory was allocated, as expected, but when switching back to Basic Weather, even more memory was allocated, instead of freeing some.
  • BAD Some 3D Clouds remained visible even after having Advanced Weather and 3D clouds disabled.
  • BAD Reducing LOD after having increasing it didn't free up memory, it did however slow down the rate on which more memory was allocated, as expected.
  • Although with the insane viewing/lod settings I was using, CPU use remained low, the FPS did drop very much, the FPS drop on itself is expected, but because the CPU load didn't increase at all, then I assume I am getting limited by the GPU?

In the end of this 3 hours flight the RAM use by FG was around 7.9 GB.

So what it seems is that there's no garbage collector at work nor a system that unloads unused data.

The good, FG remained flyable and stable throughout the test. Right now at 2:30 hours of flight time external view FPS is stable at 12 FPS and cockpit view at 14 FPS.

System Specs:
CPU Second gen 4 core 2,2 GHz Intel i7, FSB at 1333MHz
GPU Intel HD 3000
Memory 8 GB (2 * 4 GB DDR3 in Dual channel), 1333MHz
OS Debian Linux Buster - 10.7
DE MATE
FG and SG versions Next compiled yesterday evening.
Compiler Flags -march=native -mtune=native -Os -pipe (Same results with -O2 and -O3).

1 Attachments

Discussion

  • James Turner

    James Turner - 2021-01-15

    Thanks for doing this investigation, it does fit some other reports.

    Note there's no such thing as a garbage collector in C++, we always have to do the work manually to delete things we are no longer using. This should happen when tiles are unloaded, obviously that is not happening.

    However, there's a question here: if you do a 'reload scenery' or a 'reposition' (i.e using the 'airport location' or 'position in air' dialogs), does the memory use drop, or not? This should cause the entire tile cache to be dropped, which hopefully would delete most of the memory. We never delete textures unfortunatle, so if you swap texture schemes mid-run, you will keep both around until you quit.

    If you can establish whether a 'reload scenery' makes any difference or not, we unfortunately still have a lot of work to do, to identify where the problem is, but it would be a good first step.

     
  • James Turner

    James Turner - 2021-01-15
    • status: New --> NeedInfo
     
  • Megaf

    Megaf - 2021-01-16

    I've done some testing on todays latest commit on next.
    Reloading scenery doesnt seem to affect memory use much, I couldn't notice any change.

    And good news I think? Using Select Airport -> Go To Airport makes memory use oscillate ~100MB and then back to the normal use of before.
    That said, if I spawn at EDDF, then memory use quickly climb to 2.1 GB and stays between 2.1 and 2.2GB when moving between airports, even if Im at a very simple airport in a tiny island in the middle of the ocean.

    Now, if I spawn at SBFN, the simple airport in the tiny island instead, the memory use is just 1.3 GB,
    Then I go from SBFN to EDDF using select airport, memory use climbs again to 2.1 GB. When moving back to SBFN the scenery loaded quick, because it was never unloaded from RAM and memory use stayed at > 2GB.

    FYI, all scenery/world 3D models, objects are disabled, no even wind socks are enabled/available.
    So I reckon the memory use would be much larger if objects, building and models were enabled.

     

Log in to post a comment.

MongoDB Logo MongoDB