question

Koya Tamura avatar image
Koya Tamura asked

Why does memory availability keep decreasing?

Why does memory availability keep decreasing?

What I tested is:

1, Call RequestMultiplayerServerAsync to activate the server on VM.

2, A client connects via Websocket to server activated.

3, After 5 sec, a client disconnects, and the server shutdown.

4, Do 1-3 repeatedly for 5 hours.

Then I found that memory availability is keep decreasing.

My understanding is that when the server shutdown, the resources of the server is freed. That would mean that the memory availability of the VM should be restored.

Is my understanding correct?

And how should I avoid this problem?

Thank you!

Game TitleId: B7F80

VM ID -> vmss:EastUs:B7F80_33337c4c-5b55-49db-bfa1-6fe84a30d160:33352c88-71eb-436b-978d-63f1f1b36a97

Configuration is here:

multiplayer
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Austin Brunkhorst avatar image Austin Brunkhorst commented ·

Please run your game server locally with Valgrind and see if it outputs any useful information about where memory leaks may be occurring. Are you using a prebuilt game engine (Unity, Unreal, etc.) or a custom engine?

0 Likes 0 ·
Koya Tamura avatar image Koya Tamura Austin Brunkhorst commented ·

I'm using asp.net core for the server application.

I guess, even if memory leaks occur, memory should be released when the server shutdown. Is this wrong?

0 Likes 0 ·

1 Answer

·
Austin Brunkhorst avatar image
Austin Brunkhorst answered

Theoretically - yes, the memory from each game server instance would be freed. However, I think the screenshot of your memory availability for 5 servers per machine doesn't raise any concern. It's expected that memory is used over time. The VM agent that is orchestrating the startup/shutdown of each server has its own memory overhead. This is why it's important to utilize metrics to find a good balance between VM size and servers per machine to be most cost effective for your use case.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Koya Tamura avatar image Koya Tamura commented ·

I'm trying another test that 20 servers per machine. It looks like no problem because memory availability is stable at around 80%.

Thank you for your quick reply!

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.