Issue information

Issue ID
#2325
Status
Fixed
Severity
Medium
Started
Hercules Elf Bot
Oct 8, 2008 10:21
Last Post
Hercules Elf Bot
Oct 8, 2008 10:21
Confirmation
N/A

Hercules Elf Bot - Oct 8, 2008 10:21

Originally posted by [b]vhx[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=2325

So I started having issues where my server was starting to creep up in memory usage. It'd start around 150MB and over the course of 2-3 days it'd go up about 100MB or so. Definitely an issue because I started getting funky behavior in the server with warnings such as no free object id's and many other issues. On a side note, when the server crashes it doesn't spit out a leaks file (same goes if you stop it using a program like Ragnarok Server Console) I had to @mapexit to get a leak file.

Long story short I figured it was a script causing issues, just didn't know which. After 2 days of the server being online, the memory usage rose 100MB. I ended up @mapexiting to get a 19MB leakfile! Most of the errors were in chat.c. My server doesn't have many people, let alone people AFKing constantly in chat rooms. So I failed to understand how a chat.c would leak so much. Then it hit me, I installed a script that gives countdowns until next WoE. Its countdown uses a room to display. So it seems NPC's that have rooms (chats) open will eventually cause memory leakage. Especially it's more noticeable with this one since the chat is constantly changing. I had some minor memory leaks once before in another script, using an PvP ladder that had a chat/waiting room as well.

However I am not sure if this is the script issue or a coding issue. Below is an example of a script that will leak a lot. Load the below script, leave it for a while, mapexit and poof.

http://www.eathena.ws/board/WoE-Info-Banne...er-t197854.html

CODE
0056 : chat.c line 29 size 212 address 0x0x7b4ca81c
0057 : chat.c line 29 size 212 address 0x0x7b4caccc
...
369881 : chat.c line 29 size 212 address 0x0x73270664
369882 : chat.c line 29 size 212 address 0x0x73270754
369883 : chat.c line 29 size 212 address 0x0x73270844

Yes 369,000 lines or so of chat leakage. There were some other leaks in script.c, pc.c, and db.c up until the 55th line. Then it was all chat.c.

I am pretty confident this is the issue, but I will continue monitoring my server on this.

This post has been edited by vhx: Oct 8 2008, 04:20 AM