Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
zannai
Novice


Joined: 21 Jul 2008
Posts: 41

PostPosted: Sun Nov 21, 2010 12:35 am   

[3.32] memory errors.
 
Evil or Very Mad I'm having memory addressing errors bigtime after upgrading to 3.32 . additionally, after getting these errors, parts of pkg files are blown away. This is getting seriously frustrating... Can anyone tell me where to start looking... I NEVER had this problem in 2.37

Do all pkg files belong in the packages folder, or should they reside in the session folder? I'm drawing for any ideas at all at this point
Reply with quote
Daskalos
Beginner


Joined: 02 May 2010
Posts: 14

PostPosted: Sun Nov 21, 2010 4:42 pm   
 
This is a problem I'm having as well, and talking to multiple other cMUD users, it's apparently a widespread problem.

After a certain amount of scrollback happens, cMUD will freeze, spinning up my ram usages to 25% (I have 8GB) and all 4 cores of my processor spin up to about 50%.

Unfortunately, since most spam comes during major bashing and\or fighting, I end up dying a lot because cMUD completely freezes.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Nov 21, 2010 5:34 pm   
 
I can pretty much guarantee that both your problems are due to a corrupted layout, corrupted packages, and a corrupted mapfile. Check out the shift trick, XML export/import process, and the mapconvert utility to learn how to uncorrupt these files.
_________________
EDIT: I didn't like my old signature
Reply with quote
zannai
Novice


Joined: 21 Jul 2008
Posts: 41

PostPosted: Mon Nov 22, 2010 1:25 am   
 
MattLofton wrote:
I can pretty much guarantee that both your problems are due to a corrupted layout, corrupted packages, and a corrupted mapfile. Check out the shift trick, XML export/import process, and the mapconvert utility to learn how to uncorrupt these files.


Matt, Could you elaborate on the 3 tips, or provide a thread link to them? Thanks!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Nov 23, 2010 5:00 pm   
 
Shift trick: When viewing the Session window, hold down the SHIFT key and select the Open Offline action for your session. This will reset the window layout. Lots of window layouts in v2.37 were corrupted. So this is the first thing to try.

XML export/import: Open your session offline and go to the Settings Editor. Use the File/Export All command to export all of your scripts to an XML file. Now exit CMUD and go find your *.PKG file for the session (usually in My Documents\My Games\CMUD\SessionName\SessionName.Pkg). Delete or rename that *.PKG file. Now run CMUD and select Open Offline. CMUD will create a new *.PKG package for your session. Go to the Settings Editor and use File/Import to import the XML file that you previously saved.

This will recreate your package database. v2.37 had some bugs that could cause corruption of your packages in some rare situations.

Corrupted map: Download the Map Conversion program from the Downloads page on www.zuggsoft.com. Run it and locate the *.DBM map file that was converted to CMUD v3.x. Click the Repair button to repair this file.

Finally, if you are having trouble with CMUD freezing during a large amount of scrollback, that is usually caused by badly written scripts. Run the Script Debugger to see what scripts/triggers are running during your combat and track down the scripts that are taking the most time.
Reply with quote
Daskalos
Beginner


Joined: 02 May 2010
Posts: 14

PostPosted: Fri Nov 26, 2010 12:37 am   
 
I've done all of that, and I'm still crashing. (and I'm not using your mapper).

The specific message is: Out of Memory.

Which is about impossible with my system, considering I can edit HD video and run after effects at the same time. Hardware is *not* the issue.

I'm seriously thinking you've got a memory leak somewhere that after cMUD has been open for x amount of time, or processed too much too quickly, it starts freaking out. I dropped 20% Ram usage (about 2 GB) just by restarting cmud.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Nov 26, 2010 6:36 pm   
 
There's no memory leak, Dask, you've got badly-written scripts. Since you are neither the original poster nor have you provided any information about your CMud setup, the two major points I can think of are that you have triggers/aliases/events/etc running far more often than you realize or that you are always using by-value variable calls (essentially, every time you use @varname to refer to a stringlist or datarecord variable you are putting extra copies of the original variable into memory). Moderate- to large-sized stringlists/datarecords can eat up a LOT of memory in a hurry in this way.
_________________
EDIT: I didn't like my old signature
Reply with quote
Daskalos
Beginner


Joined: 02 May 2010
Posts: 14

PostPosted: Fri Nov 26, 2010 9:21 pm   
 
MattLofton wrote:
There's no memory leak, Dask, you've got badly-written scripts. Since you are neither the original poster nor have you provided any information about your CMud setup, the two major points I can think of are that you have triggers/aliases/events/etc running far more often than you realize or that you are always using by-value variable calls (essentially, every time you use @varname to refer to a stringlist or datarecord variable you are putting extra copies of the original variable into memory). Moderate- to large-sized stringlists/datarecords can eat up a LOT of memory in a hurry in this way.


My compatability report comes back clean, and nothing is uncompiling.

I'm running a lot of stuff off of GMCP data (making cMUD respond to the actual data string), but let me pose this question to you, Matt:

Is cMUD capped at the amount of memory it can use in a 64-bit operating environment? I ask, because it freezes at 25% cpu usage and 44% RAM usage, but... I have plenty more power.

Also, why does it seem to work after a set amount of scrollback (which combat accelerates)?

I have multiple databases, but the largest one I have is the affliction one, which has around 130 variables handled within.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Fri Nov 26, 2010 10:12 pm   
 
Dask,
Can you upload your package to the package library? This way we can install it and see if we see anything that maybe causing your issues.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Nov 26, 2010 10:40 pm   
 
Quote:

My compatability report comes back clean, and nothing is uncompiling.


I don't think you quite understand the role of the compatibility report. It's there to point out (the user has to fix them) obvious zmud-style mistakes. It's not there to turn bad/less-efficient CMud code into good/more-efficient CMud code. That can only come from experience, keeping up with new features, and applying new knowledge to your older scripts (and it helps if you have the script debugger open so you can really see what CMud is doing). While working code will never stop working (the introduction of bugs notwithstanding), its efficiency and memory footprint can change based on feature modifications and most of the time that's going to result in less-efficient scripts. The introduction of by-reference variable calls is an example of this.

Quote:

Is cMUD capped at the amount of memory it can use in a 64-bit operating environment? I ask, because it freezes at 25% cpu usage and 44% RAM usage, but... I have plenty more power.


Dunno how multicore CPUs work, but I figure since CMud is older than almost that entire feature set it's probably doing things in a way that can only use/see one core.

Quote:

Also, why does it seem to work after a set amount of scrollback (which combat accelerates)?


What's your refresh rate at in CMud? I believe the default setting is 6. Similarly, what's your scrollback size? If CMud is not using the full capacity of your computer, setting a huge scrollback buffer is going to result in very little memory left for script execution.
_________________
EDIT: I didn't like my old signature
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 29, 2010 6:19 pm   
 
CMUD has no memory cap, but it is only single-core. So 25% on a quad CPU system would be normal.

Your "out of memory" error is coming from one of your scripts that has an infinite loop in it. It's not running out of "normal" RAM, but it's likely running out of stack space with an infinite loop.

Try running the Script Debugger window to see exactly what script is running, although it's possible your script might lock up CMUD before it has a chance to update the debugger window. The only other thing you can do is add #debug commands to your script to track exactly what it is doing.
Reply with quote
Moo
Apprentice


Joined: 10 Apr 2009
Posts: 145

PostPosted: Fri Dec 03, 2010 10:17 pm   
 
I just got the "out of memory" error, so I checked task manager.
CMUD was using 605M working memory, 1.5G commit. Shocked
Can I find out why, or do I just have to restart it?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 06, 2010 5:01 pm   
 
Sounds like you have a script with a problem in it. There isn't any way to determine what the problem is after the fact. All you can do is normal debugging techniques such as the Script Debugger and enabling/disabling scripts and watching the memory usage in the task manager to see which script is using up your memory. But that isn't the issue that the original poster is having.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net