RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Overload ... Memmory Leek or .. ?

Yyrkoon

Wanderer
First of all, let me start off by saying that you guys (RunUO Team) have done a great job with your server EMU. Secondly, while Microsoft may CLAIM that Memory leaks arent possible in the .NET platform, there is still the possibility. There is also the possiblity that the 'memory leak' lies within the OS itself, or another commonly used program, that many people may or may not be using, reguardless I personaly think there is something going on. Example:

I play on Phlehyas' shard, and asked him to spawn trammel, server mem usuage was pretty much standard at 127 megs up to that point. After trammel spawned (which took like 2 whole minutes for the spawn alone) mem usuage jumped up to 350, and frequently went up to around 370 megs. Now in this example, the spawn increase was less than double of what was already spawned, but the memory load tripled... After a few hours of playing I checked the memory load again, and it was around 427 megs, going back down after awhile.

There can be more than one explaination of whats going on here, like XMLspawner is faulty (the spawner for the shard), RunUO server is faulty, the web host admin just happened to be running extra apps on the box doing maintanence, and im sure there are 100's more possible.

Personaly, I would like to think there isnt a 'memory leak', and maybe there isnt, however I do think this justifies a little extra debugging in the next release, but then again, its not my project. Also woouldnt hurt to check XMLSpawner.

On a side note, I was wondering if you guys at the RunUO team planed on adding server farm support, or making it possible for different instances of the server running different regons of the maps.
 

Zippy

Razor Creator
Okay to reiterate, due to the nature of memory managed languages it is IMPOSSIBLE for runuo to 'leak memory'. It is possible for the .NET platform to leak memory, but I find that fairly unlikely, and it is possiblew for Windows to leak memory but thats also fairly unlikely (for XP/2K anyway).

RunUO uses lots of ram. It is a server, not a little program. a SERVER, ment to be run on server hardware. If you have 31,000 npcs on your home computer then of course you are going to have problems.

In reguards to speicifc memory usage concerns:
Because of the way a managed language works, memory is not freed as soon as it is no longe rbeing used, so after preforming a large operation like spawning trammel the server will continue to report higher memory usage for an indetermainant amount of time... This usage will slowly fall of the course of maybe a few hours back to reflect what is actually being used. Secondly, the longer your server is up the more memory it will use. OF COURSE! when RunUO starts it does not preload map files or anything like that, mul file information is loaded on demand, so when you first log into your server and run across britian, britain will be loaded into ram as you run.
The more NPCs the more memory your server will use... OF COURSE! NPCs are more than just NPCs, NPCs have clothes and loot with also take up memory, in addition each spawner has a reference to each NPC it spawns, and other factors. Also a spawner spawning has the same effect of a person walking on every tile in the home range of the spawner... Those tiles are then cached to speed up future accesses. So if you start your world and it uses 1mb of memory, and then you spawn the whole thing, expect usage to rise based not only on the number of NPCs spawned but on the area of the map that they cover.

It is possible but excess swap file hits will cause RunUO to slow down, but those should not cause a 100% cpu spike longer than a few seconds, and even that should be rare. However, as I said, some ethernet cards have problems with RunUO's overlapped socket IO, and as a result can just kinda crap out at random times while runuo is running.

Thirdly, your custom scripts are your problem. OFTEN and I mean VERY often people write and publish custom scripts that can do wonderful things at wonderful costs. Everything has a cost, and effects can be drastic. Anything from a nested foreach loop to accidentally doing new Mobile() too many times can have drastic effects on memory.

With C# come power and with power comes responsability. One custom script can bring RunUO to its knees. There are known issues with several popular scripts including bobsmart's basehire and FACTIONs. Yes factions can have a very serious negitive impact on your shard.

Forewarned.
 

psz

Administrator
*deleted due to the fact that Zippy more than illustrated was I was trying to say ^_^*
 

Zippy

Razor Creator
Also I think we should note in the screen shot above that RAdmin is using 40% of the cpu and RunUO is using 60%......

And of course if you run the UO client on the same machine as the server then you will obviously get terrible performance.
 

Menta2K

Wanderer
10x alot for the explain
if i understand well that mean if ppl try to start a RunUO on PC with <1GB ram and more then 50 ppl to do a restart every 12 hours or to upgrade a PC :)


And all of us wait a next relece

PS: Sry for my bad english
About RA i can make a screen shot witout RA tomorow but situation will be 99 for Runuo
will do it for u
 

Yyrkoon

Wanderer
Zippy said:
With C# come power and with power comes responsability. One custom script can bring RunUO to its knees. There are known issues with several popular scripts including bobsmart's basehire and FACTIONs. Yes factions can have a very serious negitive impact on your shard.

Forewarned.

This was part of my point, meaning any number of factors can account for 'memory leaks', excessive loads, ect. Also Id like to add that until recently it was thought not likly for someone being able to remotely shutdown someone elses computer, when that computer used XP. We all know now that wasnt true. Heres a paradox, if a program written in a memory managed language isnt possible to 'leak memory' , yet a script executed thru that program can, what does that say about memory managment ?
 

Zippy

Razor Creator
Yyrkoon said:
This was part of my point, meaning any number of factors can account for 'memory leaks', excessive loads, ect. Also Id like to add that until recently it was thought not likly for someone being able to remotely shutdown someone elses computer, when that computer used XP. We all know now that wasnt true. Heres a paradox, if a program written in a memory managed language isnt possible to 'leak memory' , yet a script executed thru that program can, what does that say about memory managment ?

No, you're missing the point. nothing in .NET can cause a memory leak. A memory leak is impossible, if you think its possible, then you dont really understand .NET or you dont really understand the meaning of the term....

It is possible for things to use extra memory, which may take a while to be freed. The most common cause of this is of course custom scripts.

Scripts cannot "leak" memory any more than the core can, it's not possible (unless there is a bug in the platform which i unlikely, and we have to assume there isn't), but scripts can "waste" memory.
 

Menta2K

Wanderer
Good Memory Usage
The GC takes care of memory leaks, but it doesn't prevent memory retention. As a developer, you have control over your object's lifetime. If you can reduce the working set of your application, performance will improve. If your application is designed in such a way that many objects remain alive for a long time, an argument could be made that you have a memory leak. Even though the memory is cleaned up in the end, you are still paying a performance penalty, so it is worth knowing how long your objects live.
http://msdn.microsoft.com/msdnmag/issues/03/01/netprofilerapi/default.aspx

I think that topic must be closed becouse go to far away from the 'path'
 

Menta2K

Wanderer
2 posible temp solutions for ppl that dont have enught RAM
this must mm chek CPU usage every 10 min and i if its over 90% will restart the server

THIS SCRIPTS IS NOT TESTED YET
 

bean56

Wanderer
of course he deleted them and btw zippy you can run client and server on same computer, just have to have a very up to date computer and not a lot of ppl on server, not a 30k mobiles server ect ;)
 

psz

Administrator
I run two copies of the client on the server machine.... I have ~30K mobiles, and ~150K items...
 

clayton_ross

Wanderer
i got one hell of a great idea for the guy with nothing custom and all the problems copy your whole runuo folder to a diff computer and see if it does the same thing. if there is nothing custom and you dont have any messed upspawns i bet it wont
 

Shardace

Wanderer
I can see why this thread is here... the fact is sphere didnt take up as much resources. People got used to it.
 
Top