Low fps and extremely degradation of the performance overtime

GTA V version? 1.0.231.0
Up to date? Yes
Legit or Pirate copy? Legit
Steam/CD/Social Club? Social Club
Windows version? Windows 10 1709
Did you try to delete caches.xml and try again? Yes
Error screenshot (if any) No error
System specifications Intel I5 4460 3.20Ghz, Zotac NVdia GTX 970 4GB, ram HyperX 8GB 1600Mhz, 1 SSD and 2 HDD (no raid).
What did you do to get this issue? Just playing for at least 2min
What server did you get this issue on? All the server, on someone more, on other less, but the issue is always present
CitizenFX.log file As attachment CitizenFX.log (150.3 KB)
.dmp files/report IDs I honestly donā€™t know what is this, sorry.

If an issue with starting:
GTA V folder screenshot


GTA V/update/x64/dlcpacks screenshot

Filepath to FiveM folder C:\FiveM

FiveM client folder screenshot


Did you try to disable/uninstall your Anti-virus? Yes

Also add what you already tried so far.
So, i will start to say that i donā€™t write or talk english very well, so sorry for any error. With my configuration i play GTA: Online at 100fps with medium/high settings, the first 3 days i play FiveM, i was around 60-50 fps all the time and it was good, but at the third day i met a enormous issue with the performance. I started to play with 30 fps and for every minute i play, the fps go down, down until they become 10. In 20 minute the fps go from 30-35 to 10 stationary. I need to reboot the game for start over from 30 and go down again to 10. The issue came when i was play on the same roleplay server in those 3 days, so i try (even if the server wasnā€™t been update or modificated in that 3 days, i even ask to the admin.) to play in other servers, nothing to do, the issue is the same, maybe in some server i start with 40fps but they will always go down to 10 in 20 - 30 minutes max. GTA V standard use 80-99 % of the GPU and 90% - 98% of the CPU while in FiveM the GPU is 30% used and the CPU 60% used. When i have this drop of performance, the usage will just go down as the fps to a 10% of GPU usage, the CPU always remain to 60/70%. At least 1gb - 600mb of ram is at 99% always empty and GPU Vram is around 3,8GB all the time. I try everything, reinstall FiveM, clear the cache, renistall fiveM on the HDD, verify GTA V files, reinstall the GPU driver, defragging the HDD, update windows, use the window mode, the borderless mode, change resolution, change settings in nvidia panel control, change graphic settings, try other servers, disable antivirus, disable programs like Logitech or Steam or Audio panel control, paging file augmented, disable shadowplay, rebuild the PC hardware. The temperature are fine for every component and i repeat, i play GTA V and GTA: Online or every other game fine but no FiveM. In the server there is me and other 2/3 people on a population of 100 to have this problem, exactly the same, this enormus degradation. At least i never crash. We donā€™t know what to doā€¦ Other people with worst computer build can run FiveM fine so, i really donā€™t know what to do. Someone help me please, i cannot enjoy my game experience with 10 fps and iā€™m desperate to know how to resolve this issue. Thank you.

4 Likes

Performance issues? Try uploading an ETW capture.

1 Like

Thanks for aswering me, i hope i did good because i really donā€™t know completly how to use this UlforETW, i did the trace for a while in idle and after meanwhile i was playing FiveM. If i did wrong tell me, i will upload again the right trace.
The file itā€™s too big for upload in the forum, i link him trough Google Drive, itā€™s around 80mb
https://drive.google.com/open?id=1M7CiQVrCI2GU6DSTTohlVTDAEus7v8jS

This trace does not seem to have any game event activity (the game was maybe idle in the background?), the link in the above post got fixed however to link to the proper guide (a u slipped in on mobile :frowning: ), try to follow that maybe. :open_mouth:

1 Like

So, i did 4 trace for be sure, all of them while i was playing in full screen FiveM and the focus was on that, i was driving. I used the shortcuts for activate and save the trace and i think i use 2 or 3 alt-tab for some seconds in one trace (so in that moment FiveM wasnā€™t on focus). I hope now the trace will be correct. I also notice that if i change the video settings to very/high, ultra, the use of the gpu will increase to 50 - 60% (far away from the 99% of normal GTA V) but the fps will remain exactly the same and the degradation of the gpu usage still remain as the fps will drop.
https://drive.google.com/open?id=1VFnu3xjnHMRIvrmQuWLRreRApJD1RFxr
https://drive.google.com/open?id=1yN20abaoXneFV4lC3b_u6TO0ecCibKdn
https://drive.google.com/open?id=1Nevmg5hrSuBOiMhRt9Fd1QMv6kZOPFs2
https://drive.google.com/open?id=18LWiP3yfGZhyabMaUxi2LprEfRV9x_3R

1 Like

Looked at these traces, thereā€™s a few resources on the server youā€™re probably playing on that are using an excessive amount of CPU time:

(the right column is the amount of milliseconds spent running that resource on average, as a guideline to attain 60 FPS all ticks of resources + game processing must not exceed 16.67 milliseconds - as you can see, with massive outliers like vrp_chairs and realweapons, this is being heavily outdone)

2 Likes

Youā€™re right, this resource are using a lot of CPU, it might be the problem, so, can i ask why other people with worst computer build can play in the server without this problem? Why an 2014 I3 can run this server at mininum of 40 fps without this degradation of the performance? Today i play in a total different server for 2h and problem was exactly the same. And one last thing, why in the first 3 days of play i had no problem, but itā€™s started only 4 days later? I have no doubt that the server can be ā€œheavyā€ but iā€™m sure itā€™s not the only thing that cause me to play from 30 to 10 fps in 30 minutes of game with an I5 and an GTX 970

1 Like

Without seeing traces from these people, we canā€™t tell for sure - however it might be those people are bottlenecked by their GPU, not their CPU.

Did it use similar resources? A lot of popular roleplay servers/resources are written in a really inefficient fashion.

Itā€™s likely that the server you play on only added a heavy resource at a later time, or that the issues manifest themselves depending on saved data for a character.

1 Like

Can i ask you how can read my trace just like the screen above?

thereā€™s the ā€˜WPAā€™ tool that I believe can be installed together with UIforETW. some dragging of things in the ā€˜multi eventsā€™ subwindow leads to that view.

1 Like

Understatement of the century!

Thanks for posting about reading these traces. Iā€™m working on optimizing some of my resources and thatā€™s super beneficial. I know Iā€™m not contributing to help this user, but just wanted to thank you for the good idea of reading the traces.

Iā€™m talking with the admin of the server, we will try to eliminate a few resoruce and make the server lighter thanks to the trace, i will update for the result and and for the issue in the next days, maybe even tomorrow. @SaltyGrandpa , Youā€™re welcome here, i didnā€™t know about this trace, itā€™s absolutely very helpful like you said

2 Likes

Interesting - the issue with realweapons is that it seems to infinitely spam new CreateThread calls, apparently in the following code:

  Citizen.CreateThread(function()

    RequestModel(model)

    while not HasModelLoaded(model) do
      Citizen.Wait(0)

ā€¦ where model, for whatever reason, is 0. This is probably caused by certain models in the resourceā€™s configuration being '', and the resource author (@Sighmir) not having anticipated this kind of failure.

Eventually, this leads to an overload of pending threads in the scheduler, and as the scheduler is responsible for figuring out what to execute, and these threads all have a wake time of 0, this does explain the performance getting worse over time for this resource - the longer one plays while holding one of these weapons, the more threads get created, and the more the scheduler will have to work.

Interesting how a performance bug could hide in this tiny a detailā€¦

Fun thing to try: take the realweapons resource (source), and replace the Wait(500) with a Wait(0), and see your memory get torn to shreds, and frame rate disappear within a minuteā€¦

3 Likes

Iā€™m just here e to explain that I am not the original creator of the real weapons, only the version that works without vRP or ESX. I canā€™t take the full credits as the author of it. This is the original script: https://github.com/ESX-PUBLIC/esx_realweapons and it might not have the same issues, I agree with astatine, I didnā€™t really expect it to work in that manner, but now that you pointed it out it makes sense, I probably overlooked it at the time because I didnā€™t know as much.

2 Likes

Ah. That possibly worsens this issue - it seems that this SpawnObject function is part of the ESX framework itself, so possibly a much larger set of resources could be affected by this kind of bug. Is anyone responsible for ESX still who can fix this on their end as well, or will be have to implement a weird workaround?

The fix for this is using IsModelInCdimage() or w.e or having a timeout. But it also seems like a fairly common pattern that will arise in other places too? The engine returns 0 handles everywhere as errors and Iā€™m willing to bet this will bite me somewhere.

local function toModel (model)
	if type(model) == 'string' then
		model = GetHashKey(model)
	else
		model = tonumber(model) or 0
	end

	return model
end

local function LoadModel (model)
	model = toModel(model)

	if not IsModelInCdimage(model) then return 0 end -- ???????

	RequestModel(model)

	while not HasModelLoaded(model) do Citizen.Wait(0) end

	return model
end

Yeah, thatā€™s what the best practice would be. However, we can not determine what user code will do - to the scheduler, this is just a lot of legitimate infinite loops that canā€™t reasonably be identified as duplicates or non-halting.

3 Likes

After several test i can confirm that the problem is ā€œrealweaponsā€, this resource arrived to consume 17ms of CPU alone it self, anyway, not everyone have this problem, i try to do trace on different people from the server and someone has my same problem with realweapons, instead other one no, and by theiy trace realweapons consume only 0,7 ms of CPU and they play fine. In my case case, for 3 days during this week i play normal with 40 fps and realweapons used only 0,8 ms of CPU (and the resoruce was active), today i started to lag again and the resource started to consume cpu again. The admins dosnā€™t want to listen to remove realweapons from the server even if i show this topic so i canā€™t do so much. Thank you everyone for the help and the support.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.