Closed uzytkownik closed 2 years ago
Are you sure it's not the installer as reported here? https://docs.flybywiresim.com/start/reported-issues/
i.e. The sim can consume your ram though as well just naturally.
Memory is attributed to MSFT Simulator by task manager and decreases when exiting the flight - so I'm reasonably sure it is not installer.
It happened so far on experimental when I used FlyPad and did not happened without it - regardless of the number of airplanes around me - so FlyPad is my best guess.
Renamed this issue since there is no profiler in MSFS which could have indicated the flyPad consuming that memory. This could be anything.
I have had this before and inspected the JS heap myself using a special script we made, and found no instrument to be leaking. Turns out the culprit was photogrammetry streaming - turning it off instantly solved the issue.
Before we conclude anything, we should investigate further
Right. I have just a limited amount of data as each 'repro' effectively takes 2h.
Turning photogrammetry streaming did not fixed the issue btw.
Same issue here - turning on flypad results in large lag spikes in rendering and mainthread. Turning off flypad fixes the issue about 30 seconds after turning it off
Render thread is irrelevant to the flyPad
MainThread maybe.
Anyway glass cockpit optimizations are mostly on the MSFS side to be made, and they're working on it for next update
This issue or PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
There is an issue with the the simVar to check if the EFB is turned on/off in the EFB index.tsx.
const [isTurnedOn, setTurnedOn] = useSimVar('L:A32NX_EFB_TURNED_ON', 'number');
This causes a crazy amount of re-renders of the React components the EFB app, which would very much be related to performance issues, especially if render-dependent data is not properly memoized.
In addition, the EFB Dashboard page downloads a vast amount of imagery data for the map (many times per second, perhaps once every frame). This could also lead to memory and performance issues.
I have created a new branch for these render issues and will commit a new PR that will hopefully improve the situation.
I can confirm that there is a memory leak in the Map component on the Dashboard page related to the simVars updating every frame and consequently downloading the map tiles every single frame. These map tiles are stored in the in-game browser cache and will exponentially increase memory usage throughout the course of a flight.
I have written a PoC of a new version of the simVar provider that will use a subscription based event emitter to provide much better control of the update frequency on a per-instrument basis. In addition, this new provider will ensure that update events are only emitted when a simVar value has actually changed. This will possibly have some performance gains for all instruments if implemented, but it has to be rigurously tested before being implemented. I will create a pull request for this new provider as soon as I have done some more testing to confirm that it works as designed.
Also, the map component should be updated to support memoization and should export the component wrapped in memo/useMemo by default in order to further avoid unnecessary network and memory usage.
Increasing lags over time in a longer flight is predominantly a sim issue as addressed in multiple dev Q/As. The optimizations on EFB side (if required at all) will be handled in the new flyPadOS v3
Mod Version Development e049d43 and ac9fbb4
Describe the bug When fling with FlyPad it starts consuming more and more memory (after 40 minutes flight it consumes 16 GiB of RAM). It seems to be connected with fetching flypath from SimBrief.
To Reproduce
Expected behavior RAM usage is constant and system do not lag
Actual behavior RAM usage increases and system increasingly lags (it's hard to say if it is due to memory pressure, GC overhead or something else).
References
Possibly duplicate? #3949
Additional context Was this working before/when did the issue start occurring?
Not to my knowledge (does not apply to master)
Is this a problem in the vanilla unmodded game?
N/A. Unmodded game does not have fly pad