Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Memory Leak? MapleSolaxiaV2

Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
So I was trying out the server by myself and with some friends on a hamachi server.

Weird thing is, when the server gets online around few hours.. it just randomly freeze and all players get freezed, even if they logout and try to log back in, it will say their account is already logged in, So i will try with my GM account to shutdown the server and I couldn't. (I have 2 channels and I was on another one so I could login) Channel 1 stuck, but channel has no problem shutting down.

So I went around and research.. and I found out. memory leaks.
So I tried it with Netbeans to check out which part is leaking the memory.

And just 1 hour..
HashMap$Entry
LinkedList$Node

And other else, their generations have increased up to almost 20 in one hour.
PHP:
http://forum.ragezone.com/f428/source-memory-leaks-642562/

If based on this, if generations are more than 20, it means memory are leaking..

Or am I wrong?
 
Newbie Spellweaver
Joined
Sep 17, 2013
Messages
82
Reaction score
137
i don't know if it's necessarily considered a memory leak -- based on very quick research, i found this link:

let's say you cache an entry in a hashmap (monster info, for instance) and it remains there without being garbage collected for 20 generations. that's fine behavior, as it counts as your server still warming up, but it'll take up memory because it now resides in cache. i'm not sure what the linkedlist nodes would be, but chances are it could also be something related to caching information (drop data?)

my point is i don't think 20 generations should be a hard and fast rule; there could be any number of things causing the freeze issue.
 
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Hmm.. When I tried using more commands to look up from xml. Like. !search item (anything).

I am on v83 but I am using higher version XML. so it searches more than it should be comparing to clean v83 wz.
And the more I use search commands, the higher the generations will be.

I am awaiting for the GC to occur but It didnt.

I have heard people said 500MB is enough for hosting 100 players.. but how many days can it stays?
I was using 1000MB for the VM (launch bat) , running on my laptop with 8gb ram.
I dont think it is quite normal to just freeze after 12+ hours. especially with only 3 players.
 
Upvote 0
Junior Spellweaver
Joined
Sep 16, 2017
Messages
156
Reaction score
36
You could try creating and analyzing a heap dump.

If you're profiling via NetBeans, you'll have the option to create a heap dump (.hprof file); you can then open it either in NetBeans' own tool, HeapWalker (it'll ask to open it as soon as you save it), or in an external application (I'd suggest ).

This way, you'll be able to find out what's causing a memory leak, as you'll also be having detailed information on the objects.
 
Upvote 0
Newbie Spellweaver
Joined
Sep 17, 2013
Messages
82
Reaction score
137
well, maybe !search is caching results (or adding items into some cache as it goes through XMLs)? that way, because the items now live in cache, the references won't be cleared, and generations will go up.

as for ram, if you're running everything on your laptop, then i'm assuming this is some form of personal computer -- you have to account for OS services, database, your own background processes, stuff like that. also, maybe your server is freezing because the network adapter shuts off automatically, and it can't re-establish connections?
 
Upvote 0
Back
Top