statics of temp triggers

Post Reply
zhenzh
Posts: 56
Joined: Fri Apr 17, 2020 2:23 am

statics of temp triggers

Post by zhenzh »

I find killTrigger() do delete the created temp trigger but the count of trigger report in statics will not get decreased.
Is that mean killTrigger() will not physically delete a temp trigger and allocated memory can not be released until reload the whole LUA env?

zhenzh
Posts: 56
Joined: Fri Apr 17, 2020 2:23 am

Re: statics of temp triggers

Post by zhenzh »

I have such question because I find reload module spends quiet a long time(even get the mudlet hung) each time my robot keep on running for several days(a lot of temp triggers add/remove occurred)

User avatar
Vadi
Posts: 4901
Joined: Sat Mar 14, 2009 3:13 pm

Re: statics of temp triggers

Post by Vadi »

They're deleted in bulk when the next line is processed, as an optimization.

zhenzh
Posts: 56
Joined: Fri Apr 17, 2020 2:23 am

Re: statics of temp triggers

Post by zhenzh »

I may find the root cause of mudlet hung during reload process.
The issue can be easily reproduced by the command below:

Code: Select all

for i=1,50000 do
  id = tempTrigger("test", "")
  killTrigger(id)
end
resetProfile()
reloadModule(<test module>)
I think the issue is introduced by the function reloadModule(). The above issue reproduce can be avoided if I change the code to:

Code: Select all

for i=1,50000 do
  id = tempTrigger("test", "")
  killTrigger(id)
end
uninstallModule(<test module>)
resetProfile()
installModule(<test module.xml>)
Besides, the resetProfile() has another issue that mudlet may get crash if directly running reloadModule() without resetProfile() before it.

User avatar
Vadi
Posts: 4901
Joined: Sat Mar 14, 2009 3:13 pm

Re: statics of temp triggers

Post by Vadi »

OK, put it on https://github.com/Mudlet/Mudlet/issues/new please with a module to reproduce it with.

Post Reply