Attempting to find a memory leak

Posted by Teclab85 on Tue 28 Mar 2017 11:19 PM — 7 posts, 27,330 views.

#0
I have had the client open for 3 days and it is using over 800Mb of memory. I restarted it the other day after 10 days it was using over 1.6Gb. I have restarted all of my plugins thinking it was an issue with one of them but it made little difference 50Mb or so, and it was a plugin that stores some chat information so it was expected.

I am using Mushclient 5.06-pre which is included in Fiendish's r1900 package.

I am also running mush under wine 2.4 (staging).

Any help would be much appreciated.
Australia Forum Administrator #1
It's possible that the plugins (such as the mapper) are allocating memory for things like room descriptions which are never freed.

800 MB sounds like a lot, though. You could try restarting the client first, then disabling some plugins (like the mapper) and see if that helps.

Fiendish may be able to comment on whether he thinks that is a likely problem.
#2
I had tried restarting the client, which works temporarily. I had gone through and reinstalled all of my plugins but it made no difference.

After nuking my client and installing the plugins one at a time I think I have narrowed it down to the one plugin. Basts spellup. I am almost positive it is this one. Although, I am still confused as to why the client won't release the memory when I uninstall it and reinstall it.

It appears that the VM that the client spawns for the LUA script is never being returned.

(Edit)
I don't know if this is related but. When I type plugins to get a list of the plugins installed it completely crashes the whole client and returns a wine error.
Amended on Wed 29 Mar 2017 08:38 PM by Teclab85
Australia Forum Administrator #3
Could be some artefact of Wine.

If the spellup allocates memory (eg. making a table) and never releases it, then that would be a bug in the spellup script.
USA Global Moderator #4
Quote:
When I type plugins to get a list of the plugins installed it completely crashes the whole client and returns a wine error.

"when I type plugins" means it's an alias. Is that alias in a plugin? Is that plugin written in vbscript?


Teclab85, can you determine if it's just the spellup plugin or if it might be other plugins from Bast as well? His plugins tend to be heavily structured with multiple layers of nested shared dependencies. If it's only his spellup plugin then it would let us narrow the search to only the plugin bodies, otherwise it would be in the shared code and there's a lot of that.
Amended on Thu 30 Mar 2017 09:23 AM by Fiendish
#5
Fiendish said:

Quote:
When I type plugins to get a list of the plugins installed it completely crashes the whole client and returns a wine error.

"when I type plugins" means it's an alias. Is that alias in a plugin? Is that plugin written in vbscript?


Teclab85, can you determine if it's just the spellup plugin or if it might be other plugins from Bast as well? His plugins tend to be heavily structured with multiple layers of nested shared dependencies. If it's only his spellup plugin then it would let us narrow the search to only the plugin bodies, otherwise it would be in the shared code and there's a lot of that.


Fiendish, The 'plugin' alias appears to be a command in Mush. As the only reference I can even find for it is in plugins_summary.xml and that is by Nick Gammon. The interesting part is that even with this plugin NOT installed my mud crashes when I type the command. Which is why I believe it to be a client command, or something similar.

Just for full discretion I did find PluginFunctions: ^(plugins)(:|\s+|$)((?<action>[+\-A-za-z0-9]*)\s*)?(?<list>.+)?$ when I was getting all the aliases that the mud recognized. But that regex should not fire on just 'plugins'. That command appears to be from Plugin Functions from Bast.
USA Global Moderator #6
Quote:

Fiendish, The 'plugin' alias appears to be a command in Mush.

I promise it isn't. MUSHclient doesn't have any built in commands without using the script prefix.

Quote:
^(plugins)(:|\s+|$)((?<action>[+\-A-za-z0-9]*)\s*)?(?<list>.+)?$

I'm pretty sure that the given pattern will match on just plugins, because it resolves to ^plugins$$ with everything else being optional.

See: https://regex101.com/r/k72UQf/1