PenUltima Online

It is currently Sat Sep 06, 2008 10:32 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Packethook leak
PostPosted: Sat Mar 17, 2007 1:39 am 
Offline

Joined: Thu Dec 28, 2006 11:52 am
Posts: 80
there is a memory leak in packethooks, unfortunately it isn't related to what code it's inside them, it just happens when a packet is sent or received and there's a packethook for it.
it appears to affect both receivefunction and sendfunction

core version: 097 2007-01-04 RC2 Coregina
platform: windows

i did some testing, starting with a very simple and empty packethook:

uopacket.cfg:
Code:
Packet 0x11
{
  Length variable
  SendFunction stat:status
}


stat.src:
Code:
exported function status(who, byref packet)
   return 0;
endfunction


to test it i ran a injection macro that continuously equips and unequips armor, so the status packet is being sent continuously because of the armor value change.
there was only 1 player online, me, and i am sure my server alone doesn't grow in memory usage: i let it run for hours without players without getting even a mb increase

these are the results: (i disabled pagefile to make task manager more readable, with pagefile active windows continuously swaps something from physical ram to pagefile)

beginning:
Image

after 10 minutes:
Image

as you can see, the ram usage grew about 8 MB, but that's with only 1 player doing this and for only 10 minutes. being a packethook leak, and given the fact that most shards will probably have more than 1 packethook, you can imagine how bad could the leak turn out with many players.

then i tried adding some code to the hook, and this is the result:

beginning:
Image

after 10 minutes:
Image

as you can see the memory usage is pratically identical to the one without any code inside the hook

i then disabled the hook and ran the same test:

beginning:
Image
after 10 minutes:
Image

without the hook there's no leak, just a very slight variation probably due to some script running in background

that's as much info as i can, probably this is the leak that people (including me) complained for a while, hope it's easyly fixable so we could hope to see the fix in the next release ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 12:46 pm 
Offline

Joined: Wed Feb 08, 2006 1:47 pm
Posts: 8
anyone that reply here?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 1:10 pm 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 750
Location: Chicago, IL USA
Knowing the situation, the core devs might not even reply but I'm sure they're looking at it. A couple things I've reported before never got a reply but got fixed in the next release or two.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 4:25 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 8:08 am
Posts: 317
Location: Myrtle Beach, South Carolina
Do the test over again, only next time run the server for like more than one hour, at least. Maybe an entire day.

If you can. 8)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 9:08 pm 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
Can you try this with a fixed length hook and see if it still leaks with that? And post the results of course also.

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 3:11 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 548
I introduced the megacliloc packethook this week and watched as server ram usage grew. Before this PH the RAM usage was around 640MB, but now after only 25 hours it's up to 1.2GB and climbing. That's a massive difference and enough to make me reduce my restart timer down to 25 hours.

It seems to be related to the number of times players use tooltips.
My test server has the same code but no players and is only at 700MB after 22 hours. The packethook ecl is around 15KB in size. It has to be to display all the stuff we want.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 23, 2007 7:49 am 
Offline
User avatar

Joined: Thu Feb 09, 2006 11:48 pm
Posts: 35
Location: Finland
Any progress about this? After we updated from 96 to 97 RC3, the system became laggy after it had been running for a day or so. And the cause appears to be memory leek. As many of our systems depends on packethooks, we can't really do much, only way out seems to convert back to 96, and that's not progress at all. Not to mention how much futile work it would need. The whole shard is in somewhat slump at the moment, it is really deadly poison for it, (and eventually for pol community as well).

We also have a few crash dumps most likely caused by this, after the system had been running for several days. If those are of any help.


Top
 Profile  
 
 Post subject: Definitive memory leak with hooks.
PostPosted: Sat Jun 23, 2007 9:10 am 
Offline

Joined: Thu May 24, 2007 2:12 pm
Posts: 38
Location: South Africa
Exactly the same issue here and it's not just megacliloc. Megacliloc show's up easier as the hook that's "leaking" most probably because it's the most used. Other hooks also slowly, over time, hog memory. To a lesser degree, but it all adds-up.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 25, 2007 12:27 am 
Offline
User avatar

Joined: Thu Feb 09, 2006 11:48 pm
Posts: 35
Location: Finland
Can someone confirm if there's a leak in RC1 as well? At least we can say that 96.6 does not contain any memory leak (worked fine with me), and RC 2 & 3 does.

I wish devs would make more warning announcements about thease things, people who are going to update, would be saved from some serious headache if they would knew about thease things. Althought at the moment seems like all the devs are on vacant from Pol. :sad:

You should keep up the good work, it may not always seems like it, but it's really appreciated. :cool:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 25, 2007 2:26 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 548
Are you sure that 09.6 doesn't have memory leaks in packet hooks?

It was only when I enabled the megacliloc packethook on a live shard that I noticed the problem at all. If the packet isn't sent it doesn't grow the RAM. That's why on my test server it seemed perfectly fine.

From what I hear, this won't be looked at until 098 is being developed.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 1:12 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
I think we have same problem here (097 RC3 Linux): after 2/3 days POL absolutely need to be restarted because WorldSaves raise from 4 to 80 seconds, sysload from 1 to 90%, all scripts become deadly slow and memory usage grows up to fill whole system RAM (anyway this is not too strange under Linux) :(
We have a lot of hooks (more than 30) and they can't be disabled, so we'll hold on and hope devs can found a solution! :)

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 4:04 am 
Offline
User avatar

Joined: Thu Feb 09, 2006 11:48 pm
Posts: 35
Location: Finland
OldnGrey wrote:
Are you sure that 09.6 doesn't have memory leaks in packet hooks?

I'm certain that problems started when we updated our live server to 97, and if my memory works correctly, we did indeed have 96.6 before that. I've had 97 for a long time as development server, and yeah, you couldn't notice any memory leaks when nobody used the hooks.

I really hope the problem would be solved in 97, since seems like every live 97 shard that uses packet hooks, is troubled about it. Only way to keep the shard playable is to reboot pol every other night (or better, every night) and it still doesn't eliminate the lag totally.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 4:15 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 548
We are having to reboot every 9 hours, so I'd love to do it every second day! In test I regularly set it to a week with no issues of ram growth.

We use Win2k server, and I spent a lot of time tuning the megacliloc messages to be as brief as possible. Even so, we are growing at 25MB per hour. With only 1GB in the server, I was setting the restart timer very carefully to avoid swapping to hard disk. There was no noticeable lag with short messages and no disk swapping. Win2K isn't too bad at swapping out the least used code, so it got so that POL could use nearly all the RAM, but even so, a lot of players online all using the mouse-hover tooltips is a ram eater like I've never seen before.

We can live with it and I am almost sure the devs said it won't be fixed in 096/097. RAM isn't expensive.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 8:47 am 
Offline

Joined: Wed Feb 08, 2006 1:47 pm
Posts: 8
OldnGrey wrote:
We are having to reboot every 9 hours, so I'd love to do it every second day! In test I regularly set it to a week with no issues of ram growth.

We use Win2k server, and I spent a lot of time tuning the megacliloc messages to be as brief as possible. Even so, we are growing at 25MB per hour. With only 1GB in the server, I was setting the restart timer very carefully to avoid swapping to hard disk. There was no noticeable lag with short messages and no disk swapping. Win2K isn't too bad at swapping out the least used code, so it got so that POL could use nearly all the RAM, but even so, a lot of players online all using the mouse-hover tooltips is a ram eater like I've never seen before.

We can live with it and I am almost sure the devs said it won't be fixed in 096/097. RAM isn't expensive.



Yes but if the devs verify all possible memory leak we could use a server that not have to restart itself every day or every X hours..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 6:43 pm 
Offline
POL Core Developer

Joined: Mon Jan 30, 2006 9:28 am
Posts: 292
Location: Germany, Bavaria
Sounds strange... we'll investigate here...

Shinigami


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 30, 2007 2:18 am 
Offline

Joined: Wed Feb 08, 2006 1:47 pm
Posts: 8
Shinigami wrote:
Sounds strange... we'll investigate here...

Shinigami



thanks :)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 01, 2007 11:02 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
Thanks you VERY MUCH :D

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 28, 2007 9:28 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 217
Any progress in this?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 28, 2007 3:52 pm 
Offline

Joined: Thu Jan 18, 2007 2:34 am
Posts: 91
Im interested too, crashing every 2nd day because of it.

Although since upgrading to the latest core it doesn't actually 'crash', just drops all players and gives bad allocation to every script in console, and crazy messages like Exception in i/o thread (checkpoint=8, what=badallocation), etc


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 29, 2007 6:59 am 
Offline

Joined: Wed Feb 08, 2006 1:47 pm
Posts: 8
any news? :?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 2:47 pm 
Offline

Joined: Thu Jan 18, 2007 2:34 am
Posts: 91
Getting annoying now. Any word on a fix yet? Bit hard running a reliable shard when it crashes every few days due to this :sad:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 4:05 am 
Offline
User avatar

Joined: Mon Apr 23, 2007 8:18 am
Posts: 26
That's why POL 97 is a RC, not a stable release...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 2:46 pm 
Offline

Joined: Thu Jan 18, 2007 2:34 am
Posts: 91
Yes I know that. But this has been a problem for a while now, so thats why im asking when it is being fixed. I want KR support and the other new stuff too, but i think a problem as bad as this should be fixed first :/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 22, 2007 1:10 pm 
Offline
POL Core Developer

Joined: Mon Jan 30, 2006 9:28 am
Posts: 292
Location: Germany, Bavaria
the problem is fixed and tested on a live shard. an updated core will be available asap (it's planned for tomorrow).

Shinigami


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 22, 2007 1:36 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 217
That's! Just! Great!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl