Strange freeze after game start in Windows

#1

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?

Thanks.

0 Likes

#2

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

1 Like

#3

No such frezze in html build :slight_smile:

0 Likes

#4

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

0 Likes

#5

This is windows build.
https://drive.google.com/file/d/17kRte0cCrHdoEuIh5vU0-iiGwry9a0dm/view?usp=sharing
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?

0 Likes

#6

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

#7

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.

0 Likes

#8

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=)

0 Likes

#9

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

#10

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.

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

3 Likes

#11

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

2 Likes

#12

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:

2 Likes

#13

Thanks for looking.:+1:

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

3 Likes

#14

Add more info in issue. https://github.com/GameAnalytics/GA-SDK-DEFOLD/issues/34
1)Make example project.
2)Also make 2 videos, from my system.

2 Likes

#15

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: https://drive.google.com/file/d/1SX7jf9pilMHq3RQo8kh4YO7og5AxCTXr/view?usp=sharing

2 Likes

#16

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

0 Likes

#17

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

#18

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.

0 Likes

#19

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.

0 Likes

#20

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