Bug or Brilliant Optimisation?

Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
edited September 2012 in Server Discussion
It's got to be a bug.. surely...

Ok, so I run my GorgeCraft server on my machine, and watch the Mem usage creep up to 380mb. (Less than half of vanilla NS2). After a period of letting the server load up properly and settle down, the mem usage of the server drops down to 21mb. I thought this may be an idle mode to save server resources, so I joined the server expecting memory usage to rocket, except it didn't. Waiting in the ready room, and my mem usage of the server only went up to 30mb. I joined and started building stuff, and the memory usage slowly crept up. Despite building 5 hives, a few harvesters and cysts, and the obvious infestation that creates, my server mem usage went up to a massive 45mb.

Is this a bug in reporting on the servers, or have the optimisations I have made really caused this difference? The game runs fine, everything works, but the mem usage of the server is non-existent. If this is correct, then great, you can run a gorgecraft server on a very old box, but I have a feeling there is more to this than meets the eye...

To test I started a default NS2 server instance. Initial mem usage is 780mb. After waiting an hour the mem usage is 780mb :P No server resource saving here...

What is going on?

Played some more and added a screenshot to show usages and me actually in-game at the time...

<img src="http://img.photobucket.com/albums/v260/Soulrefuge/gcserverissue.png" border="0" class="linked-image" />

Additionally, despite having no players, on the NS2 server, and despite the GorgeCraft server being up for over 30 mins longer than the NS2 server, GC has used less CPU time than vanilla NS2.

A similar thing happened to my Proving Grounds mod on our server. We run a Combat mod server and a Proving Grounds server from the same box. This is from a few builds ago....

<img src="http://img.photobucket.com/albums/v260/Soulrefuge/servermemusage.jpg" border="0" class="linked-image" />

So what is this? Have I made stunning optimisations? Why does the mem usage drop about 15mins after loading? Is this a mis-reporting bug? Why does it happen to a varying degree in all my optimised mods?

If this mem usage is correct, then I am delighted, but I just can't help getting the feeling there is something else at work here.....

Comments

  • MaxMax Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Most of the memory used by the dedicated server is consumed by the animation data for the models. You can see how the memory is allocated using the "memory" console command. Running the dedicated server for NS2 loads about 500MB of model data, so I would say that if your mod is only using 21MB then you must be loading a much smaller subset of the models.

    The memory usage for scripts can fluctuate due to garbage collection (the garbage collector will wait until a certain amount of memory is used up and then it will free any unused memory). I'm not sure if that's the reason you see the drop over time, but it could be related.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    I have seen something similar happen with vanilla NS2, it will load up and use roughly 700mb of memory, but then randomly start dropping every tick, all the way down to about 100-120 mb of usage, where it remains (but cpu usage seems to be higher, however it seems to be on a seperate thread from the main loop).
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    Thanks for the replies guys.

    I do use a tiny subset of models for all of my mods. Proving Grounds is essentially a Fighting only mod with no buildings and GorgeCraft only loads the 15 models that can be built by the Gorge.

    It's good to know the core engine runs so well and efficiently :)
  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    I realise I am likely missing something here, but why does a dedicated server need to know about animations? I'm surprised to hear it's not entirely client side.
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    <!--quoteo(post=1983686:date=Sep 27 2012, 03:56 PM:name=Rokiyo)--><div class='quotetop'>QUOTE (Rokiyo @ Sep 27 2012, 03:56 PM) <a href="index.php?act=findpost&pid=1983686"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I realise I am likely missing something here, but why does a dedicated server need to know about animations? I'm surprised to hear it's not entirely client side.<!--QuoteEnd--></div><!--QuoteEEnd-->
    To update the hitbox. It's not necessarily needed if you have very basic hitboxes, but since the game uses extremely detailed ones the animation state needs to be correct (e.g. to be able to hit the leg of a skulk).
  • RokiyoRokiyo A.K.A. .::FeX::. Revenge Join Date: 2002-10-10 Member: 1471Members, Constellation
    Ahh, that makes sense. Cheers.
Sign In or Register to comment.