Calling a Dynamic Link Library causes a Memory Leak.
This issue is known since 2009 and mentioned here:
http://www.byond.com/developer/forum/?id=703849
(please look into the few folowing posts for further details)
For the causual calls, this might not be a real problem, but i try to accomplish something with a few hundred cals per tick, and that results indeed in a problem.
I'm going on and try to find a workaround, but it would be nice, to have a way to get that Memory back somehow.
Numbered Steps to Reproduce Problem:
just call a method from any dll
Code Snippet (if applicable) to Reproduce Problem:
mob/verb/Repeat()
var/s = input(src, "What string?") as null|text
if(s)
var/i = input(src, "How many repeats?") as num
src << call("repeat.dll", "repeatString")(s, num2text(i))
for(var/j in 1 to 10000)
call("repeat.dll", "repeatString")(s, num2text(i))
from: http://www.byond.com/developer/forum/?id=703849
Please look into this thread, for further information.
Expected Results:
Actual Results:
Going to post some memory statistics later
Does the problem occur:
Every time? Or how often?
Everytime
In other games?
--
In other user accounts?
--
On other computers?
Most likely.
When does the problem NOT occur?
Couldn't find any Data on that.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Yes since 2009 most likely even before.
Workarounds:
None Yet, but maybe it's possible to reuse the memory by passing the pointer between BYOND and the DLL somehow but i don't know if that would work somehow.
To do proper cleanup you should free any memory when the DLL is unloaded, or you can also do it on a subsequent call.
For future reference, when posting a bug report you should not put in fields like "since 2009". Just put in the version you're currently using for testing, and if you know the issue dates back to an earlier version that information should go in the text of the report itself.