Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Bug reports
➜ Massive memory leak witnessed as of v4.22
|
Massive memory leak witnessed as of v4.22
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Vchat20
USA (7 posts) Bio
|
| Date
| Mon 17 Mar 2008 08:20 AM (UTC) Amended on Mon 17 Mar 2008 08:22 AM (UTC) by Vchat20
|
| Message
| This is an awful weird case I have noticed lately and mostly due to the fact my primary machine has only 512MB to work with.
I figure screenshots/images will explain more than what I can in words:
Process Explorer: http://img262.imageshack.us/img262/1421/03172008034614bk6.png
M*U*S*H Info: http://img262.imageshack.us/img262/3162/03172008042348dn6.png
I only have two worlds running and the second one other than M*U*S*H has only a few hundred lines in the buffer. I only have a few plugins running on each like reconnector, hyperlink2, grab, and showactivity.
To me it seems awfully odd for it to be using so much memory, virtual and physical, especially seeing as it's never been anywhere near this high in older versions. | | Top |
|
| Posted by
| Worstje
Netherlands (899 posts) Bio
|
| Date
| Reply #1 on Mon 17 Mar 2008 08:49 AM (UTC) |
| Message
| | I have about the same memory usage, but my plugin/trigger count exceeds the 3000 and my buffer takes 11MB at present. Of course, I haven't paid much attention to memory usage lately, but maybe sometihng on your machine changed? A plugin that goes wonky or something in the new version, perhaps? | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #2 on Mon 17 Mar 2008 09:03 AM (UTC) |
| Message
| | To isolate this, it would probably help to see the memory usage without any plugins enabled. If it goes away, that suggests that the problem is in either the plugins, or in the plugin engine somewhere, and not the MUSHclient core. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Mon 17 Mar 2008 07:40 PM (UTC) |
| Message
| This has been discussed at some length here:
http://www.gammon.com.au/forum/?id=6023
Your thread description says "as of v4.22" - does that mean it was less noticeable in an earlier version? If so, which version? If you revert to the earlier version (but don't change anything else, if possible) does the problem go away?
There is a known problem, which is unresolved so far, that if you have:
- A trigger/timer/alias that is called frequently
- It does "send to script" (rather than calling a script function in a separate script file)
- It uses a script language other than Lua
... this seems to cause gradual memory leaks.
When you use "send to script" the script engine is called to "compile" and then "execute" your script (each time). It appears that calling the compile phase frequently is somehow to blame. If you use a script file this is only compiled once, and thus any leaks are minimized.
Lua is implemented differently internally (it doesn't use the Windows Script Interface) and does not have this problem.
The problem would also apply to any plugins you have installed that meet that criteria.
It is likely to be particularly noticeable if you do something very frequently, for example a trigger that matches every line (eg. to log each line).
MUSHclient is Open Source, and if anyone can see the problem in the "send to script" part they are welcome to let me know.
As a workaround, I suggest doing one of these:
- Change from "send to script" to using a script file, and calling functions in the script file. In many cases this is a simple change, the hardest part being revamping how wildcards are processed.
For example, instead of using %1 as the first wildcard in "send to script", in the script file you need to use wildcards [1] - or whatever the exact syntax is for your language.
- Rewrite to use Lua scripting. This lets you keep "send to script" but means learning a new script language, and implementing it.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Tue 18 Mar 2008 06:55 AM (UTC) |
| Message
| Since I see you only have 1 trigger, which didn't fire, it seems the trigger in your main world is not the culprit. The timer that fired 2475 times might possibly be, if it does "send to script".
Otherwise I would try disabling or removing the plugins as a temporary measure, and see if things improve. That might at least show which is responsible. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Haha1903
(5 posts) Bio
|
| Date
| Reply #5 on Mon 26 May 2008 03:00 PM (UTC) |
| Message
| Sorry for my English.
When call GetVariable method, memory leak at v4.18
<timers>
<timer enabled="y" second="1.00" send_to="12"
>
<send>for i=1,500 do
GetVariable("exp")
end</send>
</timer>
</timers>
<variables>
<variable name="exp">3000088</variable>
</variables>
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #6 on Mon 26 May 2008 10:40 PM (UTC) |
| Message
| I confirm there seems to be some sort of problem with memory leaks, more serious than I originally realized. Try this (Lua) code in the Immediate window (Ctrl+I):
SetVariable ("exp", "3000088")
for i=1,50000 do
GetVariable("exp")
end
This seems to cause MUSHclient's memory footprint to jump by about 1960 Kb each time you run it.
I am investigating why this is happening. Naturally it isn't supposed to. ;) |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Tue 27 May 2008 12:11 AM (UTC) |
| Message
| It appears there is a bug in the way that strings are passed back to Lua from MUSHclient function calls. Basically every function call that returned a string (GetVariable being one of many) would make a copy of the string, and the original was not freed.
This will be fixed in version 4.25.
The memory leak only applies to Lua scripting (however there are known problems with memory leaks in other script languages, so please don't ditch Lua just yet). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #8 on Tue 27 May 2008 02:37 AM (UTC) |
| Message
| | Version 4.25 has now been released, so try it with that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Haha1903
(5 posts) Bio
|
| Date
| Reply #9 on Wed 28 May 2008 02:01 AM (UTC) |
| Message
| This bug is fixed.
thanks a lot. | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
29,708 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top