Strange freeze after game start in Windows


I will try add more info later. (other platforms and bundle). Not sure mb it is my platform issue.

1)When i start my game i always have strange frezze. After 3-4 second after start. It about 170-190ms
2)I spend some times, and catch it in html profiler.
3)It is a vsync. wtf?)

Any ideas why it can happened?




Interesting! Can this be reproduced on another computer or does it only happen on yours?

1 Like


No such frezze in html build :slight_smile:



On my laptop it also reproduced.
But it take less time. About 80ms.



This is windows build.
I add a fps counter. The top red value is max fps.

I can’t share project in public. But can send it in pm to your @britzl if it can help)

I will try later to make small repro case. But i do not understand why it can happened, so not sure that i will make small repro case:)

Vsync is something system? Can it be garbage collection or some loading or unloading?



It could definitely be garbage collection! Perhaps you are generating a lot of garbage during setup which gets cleaned up after a few seconds?

You can trigger garbage collection manually and also tweak the collector (using the collectgarbage() function and its argument). I haven’t made any extensive experiments with the garbage collector so I can’t give much advice.

1 Like


Thanks. I already try collectgarbage. After init collection loaded, and after game scene started.
But nothing change. I will try more experiments with gc.

Also I try not load game scene. And get same frezze.
I use a lot of lua modules in init. Mb some generate garbage. Also will look.



Is it possible to add info about garbage collection in profiler?
1)How much times it take
2)Calls on timeline

Or something else?
It can be useful in some cases, like my=)



It would be useful for sure, but I think it would require quite a bit of work and require changes to the Lua versions we use. @JCash might have some insights into this.

1 Like


I found problem).
Game is freeze when game analytics send event.

Info/GameAnalytics: Event queue: Sending 1 events.
Info/GameAnalytics: Event queue: 1 events sent.

On windows sending events, freeze game. Looks like it send in same thread. Can you please look on it?



I will have a look and test to see what is going wrong.



The GA SDK sends all events from a separate thread. I have tested in a Windows build and I don’t get a freeze in the game. I am not sure what goes wrong :confused:



Thanks for looking.:+1:

I will try to make small repro case, on this week. And share it.



Add more info in issue.
1)Make example project.
2)Also make 2 videos, from my system.



Ok thanks for the videos and test project. I tried to adding the show_dt code to my test project and also an FPS counter. I see small dip when initialising the SDK but after that FPS is steady when sending events. This the project I have used to test with:



Thanks. I have no ideas( It is a realy strange.
Add video with your project, it aslo frezze on my pc.



I only seem to get frame rate drop on initialzing the SDK but not when sending new events after this. I have double checked that the SDK codes is run on a separate thread. I am not sure if it has anything to do with libcurl or what is happening. I have tested the same c++ library in our Unreal SDK and here there is no frame rate drops. I am not sure if anyone has any suggestions what could be wrong?

1 Like


I have no real ideas I’m afraid, other than running the game under a profiler, so try to catch the culprit “in the act” so to speak.



We used to have problems with DNS lookup (using getaddrinfo()). It was the only part of the connection process that was blocking and on a bad network connection there was a noticeable stall. Could it be something similar.



If I comment out res = curl_easy_perform(curl); in our native C++ lib there don’t seem to be a frame rate drop, but it is only for the first request it happens. When sending events after there doesn’t seem to be an issue.

1 Like