EDCD / EDDI

Companion application for Elite Dangerous
Other
444 stars 81 forks source link

Shipmonitor.json high cpu usage if it has more than one ship in the file. #1238

Closed jimbot70 closed 5 years ago

jimbot70 commented 5 years ago

EDDI version in which issue found

3.3.7-B1 Voice Attack only.

Steps to reproduce

Either log into the Frontier API and switch to Voice Attack or switch to another few ships without being logged into the API.

Expected

Same CPU usage in the VA plugin as the standalone version.

Observed

Using Voice Attack Without logging into the API and without switching ships CPU usage is normal(under 2% when not running a command) but as I switch to more ships the CPU usage grows by .5-1% per ship and eventually stops around 40% usage after I have switched to every ship I own(49 total). It will stay at this level constantly while using Voice Attack.

If I log into the API and then launch Voice Attack it starts using 40% immediately after it picks all of my ships(just the names and that I own them. It doesn't get the loadouts and stuff until I switch to the ship) from the API but otherwise functions normally without the crashes or slow responses 3.3.5/6 had.

Investigation

Similar problem to Issue #1182 but it no longer crashes, is slow to respond or climbs in usage constantly. It just sits at 40% cpu usage constantly.

The standalone works fine with any combination of being logged into the API or any number of ships in the ship monitor.

jimbot70 commented 5 years ago

Bit more playing around with it and I've noticed that after awhile it eventually will calm back down to normal CPU usage until VA is restarted but takes longer the longer the more stuff is in the .json.

With under 5 ships in the .json it'll spike for a second or so and then settle down but with all 49(just the names from the API without any outfitting) it takes about a minute. With full outfitting(after switching to every ship) for every ship it takes about 5 minutes to drop back to normal CPU usage after climbing to 70% usage for a minute but will stay at normal levels until I restart VA and the cycle stars over again.

Standalone still doesn't do any of this.

jmack-87 commented 5 years ago

With the Shipmonitor plugin enabled, I am seeing not 40% CPU but a solid 95%, along with constant I/O ~1.5MB/s. Taskmgr_2019-03-11_21-46-12

Disabling the plugin, CPU usage is restored to ~0.5%, with 0MB/s I/O

Tkael commented 5 years ago

More feedback on this issue here: https://github.com/EDCD/EDDI/issues/1243#issuecomment-473311411

jmack-87 commented 5 years ago

During today's session, I had E:D API enabled, as well as verbose logging. CPU usage began ok. Not even a spike at launch. 0.5%, 0MB/s.

When I changed ships, however, CPU started climbing. 30%, 40%, 50, 65%... I shut down VA at this point. Log is attached.

Most of my ships (~25) are stored in one location. I had one ship at Jameson and another where I swapped.

Had to use 7-zip to get archive size down, then wrapped with ZIP due to Github file type restrictions... eddi.zip

Tkael commented 5 years ago

@jmack-87 That's some impressive compression from 7zip.

From FireSammy:

Just updated to VA v.17.3.8 and boom... the CPU shoots up. I backedup my profile. Deleted it from VA. Uninstalled the VA. CCleaned. Restarted. Reinstalled, imported the profile back. No change. CPU screams high. Plz check pic's. Is this a VA issue or EDDI issue,- or both?

Error CPU high

Tkael commented 5 years ago

I think I've got a candidate for the source of this issue. No promises yet - I need to get back to a shipyard to test further.

Tkael commented 5 years ago

Well darn... turns out that I'm about 11,000 further from a shipyard than I thought I was. I'm going to have to enlist some help for testing.

The attached file contains an installer with an attempted fix. Would users affected by this issue (@jmack-87 , @jimbot70, @Malic_VR, @FireSammy ) please test this version and report whether the issue persists?

EDDI-3.3.7-a2.exe.zip

Notes: If you've enabled updates for the beta channel, EDDI will report version b1 as newer. In actuality, this version is identical to version b1 except for some changes to the way we request updates from the Frontier API after a Loadout event. As stated, I'm a long way from a station with a shipyard so I can't test directly. Thanks for your help testing this!

Tkael commented 5 years ago

Aside: I tried updating to the latest version of VoiceAttack and noticed no change in CPU utilization with the latest VoiceAttack beta (though as I noted in the other issue, I've been unable to visit a station with a shipyard in some time).

Is everyone reporting this issue using VoiceAttack beta releases or are some of you on the stable v1.7.3 release?

jimbot70 commented 5 years ago

Same thing happening with this version for me.

shipmonitor.zip

Here's my shipmonitor.json. Might help if you want to try adding a bunch more ships and see if it happens for yourself.

Using the stable 1.7.3 version of Voice Attack.

Tkael commented 5 years ago

Ok. After conferencing with @Hoodathunk we think we've identified another possible contributing factor. Working on revisions now.

Tkael commented 5 years ago

A new attempt. EDDI-3.3.7-a2.exe.zip

jmack-87 commented 5 years ago

I will test this evening (~9:00 PM EST). Are there any particular test scenarios you would like me to run through?

I was planning on: Frontier API - ON E:D (V.R.) VA - latest beta (currently installed) Perform one ship swap; Perform multiple ship swaps;

jimbot70 commented 5 years ago

The new release seems to have fixed it so far for me. Starting VA has a short spike to 15% same as the standalone version but that only lasts about 5 seconds before dropping back down to the "normal" idle usage that the standalone version has.

Switching ships is working the same as the standalone version as well(one second or so spike up to 15%).

Tkael commented 5 years ago

@jimbot70 that's encouraging. :-) @jmack-87 put it through its paces. Multiple ship swaps please.

jmack-87 commented 5 years ago

As per my testing, it looks like you've nailed it @Tkael , @Hoodathunk .

The main issue for me was FPS loss due to CPU saturation. I flew for an hour, swapped through all my ships, transported a few, swapped in different systems, transported modules, stripped ships, re-fitted ships and bought and sold a Hauler. No FSP drops. CPU load for VA sat around 0.5%.

I observed minor humps during ship changes lasting ~5 seconds, as should be expected, but no spikes and no gradual climbs. In fact, everything was running so well, I noticed my Tidal app was causing some FPS jitter. That's solved now too, thanks to you folks!

Tkael commented 5 years ago

Wonderful. PR submitted. :-)

Wasp0 commented 5 years ago

Hi @Tkael Mine is slightly different i think (1254), as i got my 100% CPU usage when just logging into VA and ED, but having just read down this thread i will try the latest version as suggested tonight and get back to you. Thanks Wasp0

Tkael commented 5 years ago

Ok. Please test with the version posted here and report back. If you are observing something different, I'll need as much detail as possible about how it is different.

Wasp0 commented 5 years ago

Will do Brian, hope to be in game tonight and will first thing install EDDI-3.3.7-a2.exe.zip. Will report back with my observations.

Wasp0 commented 5 years ago

OK, Update. Re-enabled EDDI plugin in VA, and restarted PC. Started VA, the started ED. VA CPU Process shot straight up to 68% once was ED was loading. VA kicked in and said its welcome message, and VA CPU shot up again to 88%. Immediately shut VA down, and logged out of ED.

Installed EDDI-3.3.7-a2, and restated PC. Started VA, Started ED and VA CPU back to normal CPU of around 2-8% (Normal). Restarted PC again and checked again. Played ED for 2 hours and can report no further increase in VA CPU usage. Looks as if 3.3.7-a2 has resolved my CPU high issue.

Thank you Brian for your help.

Tkael commented 5 years ago

Awesome. :-D