Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2009, 09:58 AM
bergalas
Banned
 
Join Date: Aug 2009
Location: look behind you
Posts: 30
Default Memory leaks

Apparently the server has some rather large memory leaks in about 3 hours idle 5 dynamic zones ate 2+ gigs of ram. Has anyone else noticed such problems?
Reply With Quote
  #2  
Old 08-26-2009, 01:00 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

I know there were some memory leaks, but nothing that large. I've been pretty busy in RL lately, but I'm hoping when things settle down I will have time to go through and do a bit of cleanup on the code. Memory leaks were one of my planned targets to fix.
Reply With Quote
  #3  
Old 08-26-2009, 10:33 PM
drakelord
Hill Giant
 
Join Date: Nov 2002
Location: NC, USA
Posts: 182
Default

Here is some logs that might assist you with fixing the memory leaks.

Used valgrind to log world and zone servers on Debian 5 using revision 964.

http://www.netherealm-studios.com/world_log.rtf

http://www.netherealm-studios.com/zone_log.rtf
__________________
Hmm.
Reply With Quote
  #4  
Old 08-27-2009, 12:37 AM
drakelord
Hill Giant
 
Join Date: Nov 2002
Location: NC, USA
Posts: 182
Default

Err, I should have said Rev 961. Silly typo, and I can't go back and edit it, :X
__________________
Hmm.
Reply With Quote
  #5  
Old 08-27-2009, 05:59 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Here's a fix for a smaller leak based on the logs:

Code:
 14 bytes in 1 blocks are definitely lost in loss record 5 of 55
    at 0x402209E: operator new[](unsigned) (vg_replace_malloc.c:268)
    by 0x817BC51: Database::GetZoneLongName(char const*, char**, char*, float*, float*, float*, unsigned*, unsigned*) (database.cpp:1112)
    by 0x82C9A81: Client::ZonePC(unsigned, unsigned, float, float, float, float, unsigned char, ZoneMode) (zoning.cpp:473)
    by 0x82CA3BC: Client::ProcessMovePC(unsigned, unsigned, float, float, float, float, unsigned char, ZoneMode) (zoning.cpp:447)
    by 0x82CA5E4: Client::MovePC(unsigned, float, float, float, float, unsigned char, ZoneMode) (zoning.cpp:404)
    by 0x82CA627: Client::GoToDeath() (zoning.cpp:711)
    by 0x8118406: Client::Death(Mob*, int, unsigned short, SkillType) (attack.cpp:1557)
    by 0x81190CC: Mob::CommonDamage(Mob*, int&, unsigned short, SkillType, bool&, signed char, bool) (attack.cpp:3013)
    by 0x8119D23: Client::Damage(Mob*, int, unsigned short, SkillType, bool, signed char, bool) (attack.cpp:1287)
    by 0x8115D11: NPC::Attack(Mob*, int, bool) (attack.cpp:1745)
    by 0x813F481: Mob::AI_Process() (MobAI.cpp:1179)
    by 0x8104F73: NPC::Process() (npc.cpp:623)
Code:
Index: T:/svn/trunk/EQEmuServer/zone/zoning.cpp
===================================================================
--- T:/svn/trunk/EQEmuServer/zone/zoning.cpp	(revision 966)
+++ T:/svn/trunk/EQEmuServer/zone/zoning.cpp	(working copy)
@@ -476,6 +476,7 @@
 
 	if(!pZoneName) {
 		Message(13, "Invalid zone number specified");
+		safe_delete_array(pZoneName);
 		return;
 	}
 	iZoneNameLength = strlen(pZoneName);
@@ -655,6 +656,8 @@
 			}
 		}
 	}
+
+	safe_delete_array(pZoneName);
 }
 
 void Client::GoToSafeCoords(uint16 zone_id, uint16 instance_id) {
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #6  
Old 10-02-2009, 02:22 PM
prickle
Hill Giant
 
Join Date: Sep 2009
Posts: 147
Default

I haven't noticed any memory leaks with dynamic zones, yet (running rev 974). However, I HAVE noticed that some PoP zones (e.g. poinnovations and a couple of others) like to chew on 200+ MB of RAM when launched statically.

I'm running ~most~ zones on my server statically because I've noticed certain anamolies with running them dynamically that detract from the "MMORPG"/persistent world aspect of the game. A couple of things I've noticed when all zones are dynamic:
-the lack of weather change if you only spend a few minutes in a zone
-the ~same~ thing happening if you pass the same point in a zone in approximately the same time every time you enter the zone (e.g. Lodizal ALWAYS just spawns, and ALWAYS wandering around the gnolls in Iceclad)
-wandering mobs can almost always be found in the same location
-"Spawn cycles" in zones like Frontier Mountains don't work right if the zone is dynamic, and you die a lot....

Right now, I'm working on a balance of dynamic and static zones to maintain server performance, minimize RAM usage, and maintain a "persistent feel" to the world on my personal server...
Reply With Quote
  #7  
Old 10-02-2009, 08:18 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

you can turn on Persistent Zone state. What this will do for dynamic zones- it will RECORD what/where things were when zone was shutdown and when it reboots - it will put things back exactly how they were last time on
Reply With Quote
  #8  
Old 10-02-2009, 09:34 PM
prickle
Hill Giant
 
Join Date: Sep 2009
Posts: 147
Default

I missed that. I've enabled that so the zones on my server that are still dynamic will be more persistent when I come back to them. Though, I don't think it'll be exactly like a statically loaded zone, but it will will be better than a zone that just relaunched everytime I enter it.

Thanks for the pointer; I thought that was enabled by default. Obviously, I was mistaken
Reply With Quote
  #9  
Old 10-02-2009, 11:53 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Important note - the Persistent state will carry on even after entire world server has been shut down and restarted, which leads to an issue that, when persistent state was turned on - ANY alterations to DB would prevent server from booting again until you turned it off - since the recorded data was using the DB as base and once base would be altered it would no longer match the PS recording, causing the crashes.
This was a year ago however, so changes to the code may have already addressed this issue.
Reply With Quote
  #10  
Old 10-03-2009, 08:09 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Lucky for you I completely disabled persistent state loading a while back.

No one really ever had good experiences with persistent state loading, it was unmaintained and filled with bugs and exploits.
Reply With Quote
  #11  
Old 10-03-2009, 08:46 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

LOL I always thought it was nice alternative to running crap load of static zones =P
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:42 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3