suriyun-production / mmorpg-kit-docs

This is document for MMORPG KIT project (https://www.assetstore.unity3d.com/#!/content/110188?aid=1100lGeN)
https://suriyun-production.github.io/mmorpg-kit-docs
49 stars 11 forks source link

Server RAM Usage Issue #2417

Open temelkirci opened 5 months ago

temelkirci commented 5 months ago

I have server RAM problem.My server has 128 GB.I start server as 25 GB RAM usage, but It increase all the time.Players cannot enter game when server has 75 GB RAM usage.I think there is a memory leak due to my code changes or asset or vfx problem.How can I detect RAM usage problem ?.

What kind of things cause server RAM problem in Kit (Memory lack) ?

insthync commented 5 months ago

I'm going to fix it, it will have many thing to be changed, afraid it will affect your version :P

temelkirci commented 5 months ago

Thank you, but what is problem excatly ?. Is it memory leak because some references do not release properly?

insthync commented 5 months ago

Yes, that is it too, and I also want to reduce memory usage by not storing attributes/stats in to dictionary, and implements addressable assets because with Unity system, every references of prefabs/scriptable objects which set into any game objects in the scene will be loaded when scene loaded.

temelkirci commented 5 months ago

Thank you so much.I will wait next update about memory reduce

temelkirci commented 4 months ago

@insthync Sorry for reopen.But I have +100 online players in my server and 128 GB Ram.I have to restart my game everyday.Please Could you give me a example to detect memory leak in kit.I can find another memory leaks and try to fix as soon as possible.I just need some examples.

I want to ask BasePlayerCharacterEntity player = attackerCharacter as BasePlayerCharacterEntity; I do many conversion like that in kit.I am worry this cause any memory leak?

What are the memory leak reasons in KIT?.

insthync commented 4 months ago

You can try to use Unity's memory profiler or heap explorer which is not made by Unity to finding for which one use a lots of memory.

Conversion is fine.

Someone told me that turn incremental GC off is better, memory usage are reduce but it is having noticeable spike while playing.

temelkirci commented 4 months ago

When is your plan about it ?

insthync commented 4 months ago

I've told you

temelkirci commented 4 months ago

@insthync I took a memory snapshot in runtime in my server.I am not sure Leaked Managed Shell mcause memory leak in RAM.I am not sure how can I detect memory leak in memory snapshot.I share some screen shots, maybe help you.I can share whole memory profiler file for you.

Ekran görüntüsü 2024-03-06 093731 Ekran görüntüsü 2024-03-06 093935 Ekran görüntüsü 2024-03-06 094236 Ekran görüntüsü 2024-03-06 094411 Ekran görüntüsü 2024-03-06 094515 Ekran görüntüsü 2024-03-06 094611 Ekran görüntüsü 2024-03-06 094740

mhmmdciftciler commented 3 months ago

:MMORPGKit, in its bare form, increases the amount of RAM usage with a linear increase, without any add-ons. Those who developed the kit, you are in trouble on this issue. I didn't analyze it, but this was the process I observed on my remote server. I want to develop a project with MMORPGKit, can you fix please.

temelkirci commented 3 months ago

I am trying to analyze and fix it.Do you have any idea or sugesstion about it?

insthync commented 3 months ago

Yep, I am fixing it

insthync commented 3 months ago

If you guys, can't wait me to implements a new addressable assets integration and new movement features then I will publish a new version today, it will have an addressable assets integration features which you guys should use it to reduce memory leaks issues.

temelkirci commented 3 months ago

I am very appricate about it.I will try new version in my new MMORPG game project.It will be fix all memory leaks issues? Otherwise you will keep it fix it until no memory leaks?

insthync commented 3 months ago

Yes, that is what I am going to do

insthync commented 3 months ago

I will ignore more new feature requests 😜

temelkirci commented 3 months ago

Yes please, because this is very important topic.I like this kit and want to use for many projects.But stucked in memory leaks.I hope everything goes well.This integration will changed mant things in core?.If possible Can you show me your changes to apply for my old game project made by v1.82 ?

insthync commented 3 months ago

For LiteNetLibManager part, you can see changes from https://github.com/insthync/LiteNetLibManager

insthync commented 3 months ago

And I've clear ref to Unity object to avoid leaked managed shells https://docs.unity3d.com/Packages/com.unity.memoryprofiler@1.1/manual/managed-shell-objects.html

insthync commented 3 months ago

I've added you as a core repo collaborator.

insthync commented 3 months ago

Are you sure that you are using 1.82, if yes then I might add tag for that version then you can check out it then applies your change before pull new commits

insthync commented 3 months ago

:MMORPGKit, in its bare form, increases the amount of RAM usage with a linear increase, without any add-ons. Those who developed the kit, you are in trouble on this issue. I didn't analyze it, but this was the process I observed on my remote server. I want to develop a project with MMORPGKit, but I realized that this is not a good decision.

So you are not going to use my kit?, then why still asking me to fix IAP?

temelkirci commented 3 months ago

Yes I am sure about it.I updated my kit around october lastly.

insthync commented 3 months ago

@temelkirci @mhmmdciftciler do you guys works in the same team with suitech?

temelkirci commented 3 months ago

@insthync no, I have my own game company as Kayra Games.I do not know suitech and @mhmmdciftciler .

mhmmdciftciler commented 3 months ago

You misunderstood my message. Having memory problems is a problem for a serious project. I wanted to say this. I work with Suitech. My unit works on optimization issues and I wrote it here because we have the same problem.

insthync commented 3 months ago

@mhmmdciftciler So? did you try to do anything to fix it?