Do something about the memory leak!

Posted by Poromenos on Thu 05 Dec 2002 05:23 PM — 5 posts, 12,874 views.

Greece #0
MUSHClient is leaking badly... On Win98. It took up my entire memory in something like 1 hour. And i have ONE GIGABYTE of it, for god's sake :p It works fine on XP though.
USA #1
Are you using javascript? I remember reading on here some place that an issue exists with that script engine and a memory leak. Otherwise... I use Win98 with mine and have no problems of any kind.
USA #2
Dunno what yer problem is unless its linked to your plugins and scripts. The core Mush code doesnt leak, period. I use Mush for 6-10 hours at a time and Ive never had it eat memory on me. I have had issues with mudftp and some other accessories causing a few issues but thats another matter entirely.
Australia Forum Administrator #3
I have investigated the alleged memory leaks at some length in the past with the compiler debugging tools and couldn't find anything. However there *is* one thing I found recently. Due to an inefficient way it (MUSHclient) processes entities in MXP parsing, it tends to gobble up memory when parsing a script (or anything) with inbuilt entities, particularly if it is long. eg. in the calendar plugin is the line:

<!ENTITY days_to_show "14" >

I have fixed that in the next release, but if you are using long plugins, as I suspect you might be, then as a workaround, replace the entity with hard coding. Eg. in the example above, replace all:

&days_to_show; by 14

It isn't really MUSHclient's fault in a way, it appears that some operating systems don't release or re-use previously-allocated memory (properly). The fact that it doesn't happen to you under XP suggests that the memory allocation under Win98 is suspect, rather than MUSHclient itself.

If the hour in which MUSHclient ate all your memory was an hour spent reloading a long plugin (for testing) then that might well explain it.

Greece #4
That makes sense... No, i didn't load a big plugin, just MUD normally... Although in Win XP it works normally... I have allocated 500k lines, and i had like 5 worlds open, and the most i saw after 10 hours was 13 MB, which is normal if you have 10 MB for 500k lines of text... Win 98 though... 1 GB of memory in an hour or so, and I haven't even received that many lines from the MUD. Can you do something, like forcefully clear the memory that's not used by MC any more?