096.4 & memory problem

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 096.
Note: Core 096 is no longer officially supported.

Moderator: POL Developer

Post Reply
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

096.4 & memory problem

Post by orii »

I've got a problem with Pol 096, which services 2 realms at the momment, and loads about 1500 scripts during the start.
When the server is up, operating system notifies, that memory takes away about 800MB, and when the players are connected, about 1GB, and this is where the real problem starts. Every uptime hour causes increase of occupied memory for about 100MB, in spite of almost constant number of nps's, pc's and items. In spite of all, we quickly approach 2GB memory limit (windows 2k3), and a server crushes.

I wander, if you could show me the best way of tracking that memory leak, or if I set in my boot.ini file /3GB paramter, server will achieve additional 1GB of memory, which will give us some more time to server crash.
SMJ
Grandmaster Poster
Posts: 113
Joined: Wed May 10, 2006 5:15 pm

Post by SMJ »

First thing to do: Upgrade from 096.4 to 096.5 and see if there's still a problem.
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

there is a bug with stairs & etc
..o, and nothing about memory leak in core-changes.
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

I ran 096 in its various releases for over a year in test and was most impressed with the way it didn't grow in RAM usage. I could easily leave the server up for 1 week without the ram getting our of control.

I'd have to suggest it isn't the core causing your problems.

What's your problem with stairs? The height of the player has been changed a couple of times iirc. In 097 for instance I have had to raise the ceiling in a few players to allow players to walk. I can't remember if 096.6 is going to include a change for char height to fix a problem reported by CWO, but I think that's not coming out for a while, being paradoxically tied to 097 and the 097 distro being released at the same time as the 097 core.
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

stairs are not a problem. memory leak is a problem ;p
..and i dont know where is problem (core or script)

i just searching for a tools or advice to find where is 1GBram.
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

this :

Code: Select all

use uo;
use polsys;
use file;

program txtlogerscript(who)
    who := who;
    var pdict  := dictionary;
    LogToFile(":commandlog:logs/scripts.log","=============================================================");
    foreach thg in (polcore().all_scripts)
        pdict[thg.name] := Cint(pdict[thg.name]) + thg.var_size;
    endforeach
    foreach thg in (pdict.keys())
        LogToFile(":commandlog:logs/scripts.log","["+thg+"]["+pdict[thg]+"]");
    endforeach
endprogram
not show any problem in scripts, so where?
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

or maybe, please, anyone can say - what is that:

Remaining script objectimps: xxxx

last line after shutdown.
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

really noone know what is that:
"Remaining script objectimps xxx"
? :>

some screenshot
1) after restart
Image
2) after several hours
Image

1269884 (main memory)
1916928 (VM size)
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post by Bracco »

i'm sorry to bring up this post, but did you find any solution?
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

no, sorry
i think-there is still problem with packethook-memory-leak
but...without packethook my shard is totaly unplayble, i can`t test this.
Shinigami
Former Developer
Posts: 308
Joined: Mon Jan 30, 2006 9:28 am
Location: Germany, Bavaria
Contact:

Post by Shinigami »

1. Please check your script base for usage of AppendConfigFile!

2. Do u modifiy Config files using external applications while server is running?

Shinigami
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

1 ) no, with AppendConfigFile i have only script "staticsexport/import/check" etc. (i don`t remember when i used this last time - meany years ago ;p - so i think it`s not a problem)
1b) i have many scripts with datafile & logfile
2) i have external aplication : this aplication have access to data/accounts.txt (r/o)
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post by Bracco »

that should be fine, but instead there must be some other thing that causes that high memory usage... i have the same problem, and just can't figure out what's causing this
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

You can always try the crude methods.

What about on a test shard: does ram usage grow without players, if you remove the npcs files and turn off the spawner does it still grow? Can you reproduce the things that do cause ram usage to grow? Are there any situations where you can stop it growing - turn off packages etc.

I would expect RAM usage to grow slightly over time due to scripts loading and staying resident. Even unloadcfg has little effect on my RAM, certainly nothing to worry about.

Checked script.log, datafile.log?

The packet hooks in the 097 distro don't cause problems on my shard either. I guess it comes down to trying to get it to misbehave on a test shard.
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post by Bracco »

OldnGrey wrote:You can always try the crude methods.

What about on a test shard: does ram usage grow without players, if you remove the npcs files and turn off the spawner does it still grow? Can you reproduce the things that do cause ram usage to grow? Are there any situations where you can stop it growing - turn off packages etc.

I would expect RAM usage to grow slightly over time due to scripts loading and staying resident. Even unloadcfg has little effect on my RAM, certainly nothing to worry about.

Checked script.log, datafile.log?

The packet hooks in the 097 distro don't cause problems on my shard either. I guess it comes down to trying to get it to misbehave on a test shard.
i am using 097 RC2, ram usage doesn't grow without players, i checked script.log, pol.log, debug.log and found nothing strange.
to me it seems like nearly every script that runs does not release all the memory it used... so the more players, the more script runs, the more memory grows, and grows faster

i remember this problem was introduced with one of the first 096 betas, but seems like something similar was in there from before (see my post in bug reports 097)

imho, it could be related to the script caching system or something like that
orii
New User
Posts: 13
Joined: Mon Jan 08, 2007 3:03 am

Post by orii »

same here, more players = more memory disapering
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post by Bracco »

orii wrote:no, sorry
i think-there is still problem with packethook-memory-leak
but...without packethook my shard is totaly unplayble, i can`t test this.
after intensive testing i came up with the conclusion that you are right... seems a packethook leak. i am almost sure, tried disabling them on local test machine and ram usage didn't grow. gonna test it on live shard and come back with results
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm
Location: Nederland, Texas

Post by tekproxy »

I could write a quick script to connect to a server and login to a large number of accounts, if any of the core devs thought it would be useful for testing. I may do it later just for kicks to see if the distro has the same problem.
Bracco
Adept Poster
Posts: 80
Joined: Thu Dec 28, 2006 11:52 am

Post by Bracco »

tekproxy wrote:I could write a quick script to connect to a server and login to a large number of accounts, if any of the core devs thought it would be useful for testing. I may do it later just for kicks to see if the distro has the same problem.
it's not needed... it seems that the leak happens just for the existance of an hook (the hook must run to leak ofc), regardless of what code it has inside...

right now i'm testing a 0x11 SendStatus packethook, even if it's empty (only a return 0) it leaks

gonna see if ReceiveFunction leaks also

btw, later i'll post it in bug forums
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

I've gone back to a 33 hour restart for pol097.
None of the leaks showed up on the test shard, but it's amazing how all my testing was useless as soon as I went live with players. I have quite a few packethooks too.

Not surprising really. We got used to 095 over its many years of service. 096/7 is a new learning experience. It's surprisingly good and easy to maintain so far, but we shouldn't be surprised.
Post Reply