Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ MUSHclient ➜ General ➜ What does this mean?

What does this mean?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  3  

Posted by David Berthiaume   (202 posts)  Bio
Date Thu 27 Oct 2005 01:06 AM (UTC)
Message
Error number: -2146827287
Event: Execution of line 1 column 1
Description: Out of memory
Line in error:

Called by: Immediate execution
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 27 Oct 2005 04:23 AM (UTC)
Message
It is pretty self-explanatory. :)

What program are you running that causes that?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #2 on Thu 27 Oct 2005 06:24 AM (UTC)
Message
Mushclient, of course.
Top

Posted by Ekerim   Sweden  (18 posts)  Bio
Date Reply #3 on Thu 27 Oct 2005 05:11 PM (UTC)
Message
Haha...not!

What Nick was asking was not if you ran MUSHClient or not but rather what SCRIPT program/plugin you loaded that crashed.
I have gotten errors like that when I have made a bo-bo in my ScriptFile.

// Fredrik
Top

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #4 on Fri 28 Oct 2005 11:29 PM (UTC)
Message
No boo-boo's in the script file. Runs fine, just not for extended timer periods, the mud I play has just recently allowed idling, to encourage more people to play more, and to get people to cap certain classes to see what they need tweaking with.

Anyways, it's one script that is causing it, once I close mushclient and restart it, it is fine.
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #5 on Sat 29 Oct 2005 12:24 AM (UTC)
Message
What script language is that? I suspect that there are memory leaks associated with some script engines, I'm not absolutely sure it is a MUSHclient bug. I have tried hard to follow the guidelines for calling script engines, however sometimes the documentation can be obscure.

A possibility is that your script actually has an internal leak, not knowing which engine it is hard to say, but maybe if every time through you allocate something that is not deallocated, in time memory will fill up.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #6 on Sat 29 Oct 2005 02:22 AM (UTC)
Message
I can show you the script that is setting that off...

<triggers>
  <trigger
   custom_colour="17"
   enabled="y"
   expand_variables="y"
   group="InfoBarLevelScript"
   keep_evaluating="y"
   match="^\&lt;(.*)\%XTL\&gt;$"
   omit_from_output="y"
   regexp="y"
   repeat="y"
   send_to="12"
   other_text_colour="darkcyan"
  >
  <send>world.setvariable "EXPTOLEVEL", "%1"
world.setvariable "XPNEW", "%1"
dim EXPTICK, TICK, TICKERNEW, TICKERBLANK, EXPTOLEVEL, EXPFROMLEVEL, count
dim XPOLD, XPNEW, XPDIFF
XPOLD = CInt(world.getvariable ("XPOLD"))
XPNEW = CInt(world.getvariable ("XPNEW"))
XPDIFF = (XPOLD - XPNEW)
if XPDIFF &lt; 0 then
XPDIFF = (XPDIFF + 100)
world.setvariable "XPOLD", XPNEW
world.setvariable "XPDIFF", XPDIFF
elseif XPDIFF &gt; 0 then
world.setvariable "XPOLD", XPNEW
world.setvariable "XPDIFF", XPDIFF
end if
EXPTOLEVEL = CInt(world.getvariable ("EXPTOLEVEL"))
EXPFROMLEVEL = (100 - EXPTOLEVEL)
world.setvariable "EXPFROMLEVEL", EXPFROMLEVEL
TICKERNEW = "|"
TICKERBLANK = ""
TICK = "|"
EXPTICK = ""
for count = 1 to CInt(world.getvariable ("EXPFROMLEVEL"))
TICKERBLANK = (TICKERBLANK + TICKERNEW)
next
for count = 1 to CInt(world.getvariable ("EXPTOLEVEL"))
EXPTICK = (EXPTICK + TICK)
next
dim space, space2
space = "1"
space2 = "10"
world.infoclear
world.InfoBackground "black"
world.InfoFont "Arial", 12, 1
world.infocolour "white"
world.info "("
if CInt(world.getvariable ("aaHP")) &lt;10 then
InfoColour "black"
Info space2
InfoColour "white"
Info "@aaHP"
elseif CInt(world.getvariable ("aaHP")) &lt; 100 then
InfoColour "black"
world.info space
world.infocolour "white"
world.info world.getvariable ("aaHP") &amp; "%"
else
world.infocolour "white"
world.info world.getvariable ("aaHP") &amp; "%"
end if
world.infocolour "red"
world.info "HP"
world.infocolour "white"
world.info "|"
if CInt(world.getvariable("aaMana")) &lt; 10 then
InfoColour "black"
Info space2
Infocolour "white"
Info "@aaMana"
elseif CInt(world.getvariable("aaMana")) &lt; 100 then
InfoColour "black"
world.info space
InfoColour "white"
world.info world.getvariable ("aaMana")
else
world.info world.getvariable ("aaMana")
end if
world.info "%"
world.infocolour "olive"
world.info "Mana"
world.infocolour "white"
world.info "|"
if Cint(world.getvariable ("aaMove")) &lt; 10 then
InfoColour "black"
Info space2
InfoColour "white"
Info "@aaMove"
elseif CInt(world.getvariable ("aaMove")) &lt; 100 then
InfoColour "black"
world.info space
InfoColour "white"
world.info world.getvariable ("aaMove")
else
world.info world.getvariable ("aaMove")
end if
world.info "%"
world.infocolour "darkcyan"
world.info "Move"
world.infocolour "white"
world.info ") ("
world.infocolour "lightgreen"
world.info world.getvariable ("aaHunger")
world.infocolour "white"
world.info ") "
world.info "["
if CInt(world.getvariable ("EXPTOLEVEL")) &lt; 5 then
world.InfoColour "red"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 10 then
world.InfoColour "lawngreen"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 20 then
world.InfoColour "green"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 30 then
world.InfoColour "darkorange"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 40 then
world.InfoColour "orange"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 50 then
world.InfoColour "goldenrod"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 60 then
world.InfoColour "gold"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 70 then
world.InfoColour "yellow"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 80 then
world.InfoColour "blue"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 90 then
world.InfoColour "mediumblue"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
else
world.infocolour "purple"
world.InfoFont "Arial", 12, 0
world.info EXPTICK
end if
world.infocolour "black"
world.info TICKERBLANK
world.InfoColour "white"

world.InfoFont "Arial", 12, 1
world.info "] (" 
world.infocolour "yellow"
If CInt(world.getvariable ("EXPTOLEVEL")) &lt; 10 then
InfoColour "black"
Info space2
InfoColour "yellow"
Info "@EXPTOLEVEL"
elseif CInt(world.getvariable ("EXPTOLEVEL")) &lt; 100 then
InfoColour "black"
world.info space
InfoColour "yellow"
world.info world.getvariable ("EXPTOLEVEL")
else
InfoColour "yellow"
world.info world.getvariable ("EXPTOLEVEL")
end if
world.infocolour "white"
world.info "%) | Last: " 
world.infocolour "yellow"
world.info world.getvariable ("XPDIFF")
world.infocolour "white"
world.info "% | Level: "
world.infocolour "yellow"
if world.getvariable ("CharacterInfoLevelStatus") = "subhero" then
world.info world.getvariable ("CharacterInfoLevel")
else
world.infocolour "red"
world.info world.getvariable ("CharacterInfoLevelStatus") &amp; world.getvariable ("CharacterInfoLevel")
end if
InfoColour "white"
info " |"
if GetVariable ("CharacterInfoLevelStatus") = "H" then
info " "
InfoColour "green"
world.InfoFont "Arial", 12, 1
Info "Hero Points"
InfoColour "white"
Info ": "
InfoColour "teal"
world.InfoFont "Arial", 12, 1
Info "@CharacterInfoCurrentHeroPoints"
else
end if


world.EnableGroup "Highlighted Words", 0
EnableGroup "CharacterInfoInventory", 0</send>
  </trigger>
</triggers>

Top

Posted by Katherina   (19 posts)  Bio
Date Reply #7 on Fri 25 Jan 2008 09:38 AM (UTC)
Message
I've gotten the same type of error. I use vb script but the error seems random, not just from one program, but turning off the timer and triggers helps. It is not an error in my code.
I'm beginning to suspect it is the timer.
Any thing new on the subject?
Here are two snips of errors from different triggers, it keeps repeating I have to shut down mushclient and restart it.

Script error
World: aetolia mapper
Execution of line 41 column 243
Immediate execution
Out of memory
Line in error:
if world.GetVariable ("possessed")=1 and world.GetVariable ("stun")=0 and world.GetVariable ("frozen")=0 and world.GetVariable ("dead")=0 and world.GetVariable ("balance")=1 and world.GetVariable ("sleeping")=0 and world.GetVariable ("aeon")=0 and world.GetVariable ("illusion")=0 then

Script error
World: aetolia mapper
Execution of line 123 column 37
Immediate execution
Out of memory
Line in error:
if world.GetVariable ("baldness")=1 then
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #8 on Fri 25 Jan 2008 04:27 PM (UTC)
Message
Hmm. There are known issues with stuff like Python when using direct execution via triggers, I can only guess that something in a service pack or some other change has made the same thing happen with VB. Basically, when you stick code "in the trigger", instead of calling a function in the main script, the script system has to set aside a new chunk of memory ***every time*** the trigger fires. This is often not a problem for very small amounts of code, but if the garbage collection system for the engine isn't working efficiently at cleaning up those chunks of used memory eventually the script system concludes that it doesn't have enough memory to continue to do its job, even though the real problem is that it simply *hasn't released* what it was previously using. Given the nature of this issue, and the fact that it may be tied closely to MS' active script method of making these work, I would suggest, given this is the second language (the first was python) to suffer from it, that placing script commands that are called often directly into triggers, aliases or timers, instead of calling a function, should be limited to Lua, where the nature of how it collects previously used memory, and the way it talks to the client, differ enough that the problem doesn't seem to happen there (or at least hasn't yet been reported).

Basically, either Python and VB are not correctly handling memory cleanup in such cases *or* something about active script prevents it from working quite the way its suppose to.

Mind you, that is just a guess, but it seems pretty likely, given that this problem is only happening in cases where script is executed "in" triggers, aliases or timers, not when its called (and the commands are already preloaded in memory).
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #9 on Fri 25 Jan 2008 07:03 PM (UTC)
Message
I agree with Shadowfyr - there have been reported problems with "send to script" gradually using up memory, a problem that is fixed by not doing "send to script" but instead moving the relevant script to an external script file, and putting the name of the appropriate function in the script box instead.

This would particularly apply to things that are done frequently (eg. a timer that fires every second).

I do not believe the problem applies to Lua scripting, which does not go through the "black box" which is the Windows Script Host interface.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #10 on Fri 25 Jan 2008 08:39 PM (UTC)
Message
Windows Script Host is a black box? I thought it was a black hole...

I cleared up a clannie's memory errors by converting the "send to script" triggers into triggers which call functions within the script file. I just did it to consolidate the code to be readable, but it fixed the problem. I have never had a problem with Lua scripts, but I do not know if that is from avoiding WSH, if it has better garbage collection, or if it's because I have gotten into the habit of not filling in the "send" window with scripts.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #11 on Sat 26 Jan 2008 05:22 PM (UTC)
Message
Strictly speaking, if we had known this was going to be a problem from the start, some method of pre-parsing "sent to script" data could have been implimented. It would have likely required limiting the use of wildcards to "data", not variable names, like we can do now, but you could take something like:

<triggers>
  <trigger
   custom_colour="17"
   enabled="y"
   expand_variables="y"
   group="InfoBarLevelScript"
   keep_evaluating="y"
   match="^\&lt;(.*)\%XTL\&gt;$"
   omit_from_output="y"
   regexp="y"
   repeat="y"
   send_to="12"
   other_text_colour="darkcyan"
  >
  <send>world.setvariable "EXPTOLEVEL", "%1"
world.setvariable "XPNEW", "%1"
..</send>
  </trigger>
</triggers>

and convert it to:

sub <some_arbitrary_number *or* the trigger name> (wild1)
  world.setvariable "EXPTOLEVEL", wild1
  world.setvariable "XPNEW", wild1
  ...
end sub


It would have only needed to be loaded/unloaded when someone a) changed the trigger, or b) first loaded the plugin/world.

Mind you, coding the converter would have been a bit of a hassle too... lol Still, it would have been one way to fix the problem, had it been a known problem in the first place. Oh well, ce la vie.
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #12 on Sat 26 Jan 2008 07:44 PM (UTC)

Amended on Sun 27 Jan 2008 05:41 AM (UTC) by Nick Gammon

Message
It shouldn't be a problem, and I have spent some time trying to fix it when it was reported earlier. However memory leaks are notoriously hard to track down. For one thing, MUSHclient is continually allocating memory anyway, as each new line that arrives takes memory for the line to be stored, including each individual style run. Thus, a continuous and persistent increase in memory usage (as text arrives) is perfectly normal.

However if additional memory is used each time a timer fires, because it is doing "send to script" is not normal. There are a number of possible reasons:


  1. There is a bug in MUSHclient where something in the compile phase for "send to script" is allocated and never freed (eg. the script text itself).

  2. The memory used by the previous script is not freed (ie. from last time around).

  3. There is a bug in MUSHclient where something in the execution phase for "send to script" is allocated and never freed.

  4. There is a bug in the Windows Script Host (WSH) interface which connects the MUSHclient code to the script engine. This bug might be in the way I am using the WSH, or internal to WSH itself.

  5. There is a bug in the actual script engine (eg. VBscript) where the script writers assumed that a script would be compiled infrequently (eg. once per web page) and don't free all the memory they use (eg. for variables).


Some of these are outside my control. The source for MUSHclient is publicly available, so anyone who is familiar with implementing script interfaces is welcome to make suggestions.

As I mentioned earlier, the Lua interface is different. It does not use the WSH interface, is well documented (unlike the WSH interface), is easy to understand, and seems to work very well. I read on the Lua forums that they ran the Lua script engine through Valgrind or something similar and found absolutely no memory leaks.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #13 on Sun 27 Jan 2008 02:56 AM (UTC)
Message
To sum up: Micro$oft did not write the Lua script interface, hence the documentation, ease of use, and the lack of memory leaks.

Now for the non-sardonic part of my post. I would honestly not expect option #5 to be the culprit, since this issue has happened with more than just VBscript. I know the same thing happens with Python and JScript. Options #1 and #4 seem to be the most probable. Tables for parsing are notorious for getting very messy very quickly. Also, since the API for WSH is not exactly user friendly, there could easily be an obfuscated flag which needs to be set somewhere for actually clearing out old data instead of keeping it allocated.

Option #2 seems to be a given, but most likely is the result of another one of the options. Option #3 just seems not terribly likely, but that certainly does not rule it out.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #14 on Sun 27 Jan 2008 06:12 PM (UTC)
Message
Well, I didn't say it was the "only" solution, just *A* solution, if the problem happened to be 2 or 4, since it would the also the "only" solution possible.

That said... If one set up a feed, in which there is a known number of characters per line, with known numbers of color codes (or none), then presumably each "line" would take a set allocation of additional memory. One could then profile shifts in memory usage that *are not* caused by the input itself, in theory. Its a bit beyond me though. :p
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.


94,739 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.