Low fps and extremely degradation of the performance overtime

help
issue
lowfps
lag

#1

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.


#2

Performance issues? Try uploading an ETW capture.


#3

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


#4

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:


#5

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


#6

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)


#7

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


#8

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.


#9

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


#10

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.


#11

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.


#12

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


#13

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…


A performance bug can hide in the tiniest details
#14

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.


#15

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?


#16

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

#17

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.