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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Sep 07, 2010 6:45 pm   

3.25 Possible Memleak, causing Severe Issues
 
Alright, so this post has the potential to be really lengthy.

I first noticed this issue in either 3.23 or 2.34, but it has carried over to 3.25. The key problem it's causing is major lag when using CMUD, especially in the command-line, and if I can get a video of this occurring I will. But essentially I can type faster than its typing out in the command line, which isn't normal, normally I type about as fast as the words appear on the screen.

Now this obviously creates problems in the game, to the point of making it quite unplayable.

Initially I noticed that the lag in the command line took awhile to set in after the game was started. I suspected a memory leak, but had no proof nor did I know of any ways to show that memory leak was happening. I did, at one point, open up Task manager to see that CMUD was running at upwards of 200,000k memory usage. It was higher than Firefox, but I wasn't sure if that was a normal memory usage for CMUD.

Then I started having problems opening up sessions. The video I'm about to share documents the specific problem that happens, but, in description: I double click on a session, the session window opens, but the background is white, as if there is some problem. It remains in this state anywhere from 10-60 seconds, it has varied but has been leaning towards the latter as of late. Then it finally logs onto the MUD and the background goes black and shows text normally. On a couple of occasions, it has gotten "stuck" in that state and never connected. After awhile of leaving CMUD open, things like sound would start to go crazy, and the graphics on my computer would flicker or otherwise show odd behavior. Using Task manager to end the process for CMUD would solve all of those issues.
It's a link, click to see video


Suspecting layout issues, I started opening such sessions by "shift+clicking" on the session and resetting the layout. Every single time I did that it opened without issue. By default, all of my windows became tabs. If I set the windows to floating windows to the right of CMUD again, then I would have the same issues when I tried to open the session later on, however, if I left the windows as tabs, those issues would not appear when I tried to open the session, this made me highly suspect something about the windows was the issue.

Eventually I opened up Task manager one of the times it "froze" while loading up a session, and I noticed that the memory usage was sky rocketing quickly, as evidenced in the video above.

I then decided to open a session which did not exhibit the same problems upon loading, and found that the memory usage never skyrocketed to nearly the same amount. However, oddly, that session was also using floating windows, but they weren't causing any issues.

Now, to be clear, the problem happens across multiple sessions. It seems to be happening to 3 of my sessions in particular, but there's a lot of them that I don't actively use and am unsure of. I only know for certain of one session that isn't being affected. Of the sessions, the only common factor is the windows and the fact that they all share a package. However, each session also has its own package, but since they're all over varying sizes and varying info, I see of no relation of the individual packages of the sessions which are failing.

Here is a video of the session which works normally:
It's a link, click to see video


Some interesting numbers from the videos:
> CMUD seems to begin working on broken sessions once it breaks roughly 95,000k memory
> CMUD sessions that seem to work normally seem to open at about 30,000k memory and doesn't rise much higher

The sessions that have problems opening continue to slowly increase in memory as I use them. I start noticing lag issues in the command line at about 150,000k memory usage, and, as I've mentioned, I've seen it break 200,000k memory usage, but, I have a screen shot of it at just under that, by this point of memory usage, the command line is so laggy that it's virtually unplayable.


If there's anything I can do to possibly narrow this down so that it might be replicated, please let me know. I know it's an odd issue and you probably don't have the info you need, but this is the only info I know how to get. This is definitely a serious issue and I hope it can be isolated and fixed. It's quite possible that the error is something of my own, but since it happens across multiple sessions and not all, and since it didn't happen pre-3.23, I'm inclined to believe otherwise.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Sep 07, 2010 7:07 pm   
 
The memory amount is not a big issue unless it keeps going up and up. You might check your Scrollback memory settings to see how many lines each window is saving in it's scrollback. Each window can have it's own setting for this. If you have lots of windows all set to large scrollback regions, then you will use a lot of memory. It's sort of like Firefox using more memory the more tabs that you have open.

As far as the slow settings, that sounds more related to something in your shared package or scripts. I've got sessions with lots of floating windows that do not show any of these problems, so it's not just an issue with floating windows.

Use the #THREAD command to see if you have a lot of background threads running from using #WAIT commands.

When typing on the command line, each time you press a key CMUD is checking to see if a macro is assigned to that key. So if your settings are corrupted or if you have lots of macros, that might cause a slowdown.

If it didn't happen pre-3.23, then it might be related to a memory leak in some string list or database table variable. But again this will be script specific so you'll need to use the standard debugging procedure of disabling your scripts and then enable them one by one until you see the problem start happening.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Tue Sep 07, 2010 7:46 pm   
 
If I already notice the command line slowing down, will disabling various scripts work to stop the memleak? I have a max scrollback buffer, but it's never caused me any issues pre 3.23. However, I'll see if any particular script is causign it.


Edit: max, not mac

Also, the major issue is that it only gets that high in the sessions that start off buggy for some reason. In the "normal" sessions, it never gets up to 200k, or at least not nearly at the same rate. Also, any idea what might be causing the start up problem?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
dbosst
Apprentice


Joined: 15 Jun 2010
Posts: 121

PostPosted: Tue Sep 07, 2010 11:15 pm   
 
Hmm 198megs doesn't sound like too much a leak as long as it stabilizes.. if it goes up and up like Zugg said past 300-400 etc then yeah
Mine uses
~150meg with vsize of ~350m
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Sep 08, 2010 3:42 am   
 
The problem isn't the size, strictly, it's the difference in size. If all of my sessions were around that amount, it would make sense. But only a few of them consistently get that large, while the other sessions never seem to get that big. Also, with the command line lagging specifically as it rises, it shows that my problems are coinciding with a sharp increase in memory.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Sep 08, 2010 11:24 pm   
 
Question: What in my settings or triggers might be related to the hang-up at the start as shown in the linked videos? As mentioned before, if I "shift+click" the session, resetting the layout, it starts up just fine, which is why I highly suspected something about the layout to be the cause. Unfortunately, the session that works just fine would seem to have all of the same layout parameters as any other session. There's an "OnConnect" event trigger in all the sessions that does roughly the same thing (just different files for the logs) I otherwise cannot think of anything else that would cause the startup issue.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Sep 09, 2010 4:33 pm   
 
What happens when you disable the OnConnect event? Also check for any OnLoad events. As I said, you will need to take this one step at a time to pin down the problem. I'd first start with a brand new session and then create the different windows and arrange them the way you want. Then exit and load CMUD and see if it works with just the window layout. After the layout is working, then start adding your session packages until you determine which are causing the problem.

You can also try using the Open Offline option which will not fire your OnConnect event.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Sep 09, 2010 5:54 pm   
 
Will try some of the other things, but, for the moment, trying to open such sessions offline results in CMUD showing the same problem of freezing up, with the addition of never actually loading into the session at all. There was an error for one of the attempts, but when I tried to click on the error it wouldn't show (aka it seemed like it was minimized, so I found it on the taskbar and clicked on it several times but nothing happened).

Edit:
Blank session with an alias to create the windows did not cause the problem, even after adjusting the windows to how they are in the other sessions.

I created a new session, but replaced the package with the package of one of the failing sessions and CMUD froze up like it does in the video, but didn't recover. Interestingly enough, the title of the window was "Capture" which is the title of one of my sub windows and it should not have been the title of the one window that appeared.

I added the packages from one of the problem sessions to the blank session, but everything seemed normal, at least with connecting offline. It created the sub windows and I had two main windows, one for the blank session and one for the package.

So I tried to create another new session. Instead of changing the default package, however, I decided to start it off with my default cross-session package and one the package of one of the problem sessions while keeping the default package the same name as the new session. Upon my first running everything seemed normal. Windows formed as tabs and I moved them and arranged them how I wanted. I noted that the window for the problem package didn't appear, just the window for the session package. Then I closed out CMUD after saving the layout, opened it again, and tried to open the new session. The main CMUD session window appeared, but with a white background (like in the videos) but all the SUB windows appeared like normal. Additionally, another window with the same name as the main session package appeared as a tab in one of the SUB windows. However, whenever I tried to move it into the main session window I got an error about not allowing duplicates on the list or some such.

Very odd.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Sep 09, 2010 7:03 pm   
 
Quote:
I created a new session, but replaced the package with the package of one of the failing sessions and CMUD froze up like it does in the video, but didn't recover.

That narrows the problem down to the package file of your failing session. Try doing an XML export of that package and then create a new package and import it.

CMUD tries to match the unique GUID of the window stored i the *.XLY layout file with the unique GUID stored for the window object in the package. Sounds like your package has some corrupted window objects.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Sep 09, 2010 7:16 pm   
 
It may have happened across a couple sessions, but I will do this for all of them. Will the new package need a new name or can I delete all of the problem sessions and all of their packages (with XML backups) and simply recreate them?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Sep 09, 2010 7:44 pm   
 
You should be able to recreate them with the same name.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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