Open ArranTuna opened 6 years ago
@Audifire said:
Today I had time to test your code and I analyzed the problem.
So I degugged the callRemote procedure and the I got the following result:
If you call the callRemote function every time there will be created a CRemoteCall object in the C++ source code. Every of this objects are getting in a queue from downloading manager. Now when you create 100000 of the objects and the queue need to work off all this objects.
After a work off of one object the object will be deleted and the memory will be free. But here you see the speed of the work off: http://www.audifire.de/mtasa/images/workoff.png
So the code works well, but the demonstrated code example is very inefficient.
In the afternoon I will test this with a valid test result. The problem is, every RemoteCall will take about 3 seconds.
Now: 100000 * 3 seconds = 300000 seconds 300000 seconds / 60 seconds per minute = 5000 minutes 5000 minutes / 60 minutes per hour = 83.3 hours 83.3 hours / 24 hours per day = 3.47 days
The result to workoff are 3.47 days, then the memory will largely be free. :D Another problem is, that the result length is not always the same (~ 3 seconds).
@castillo14 said:
fetchRemote seems to be also affected by this, a resource using fetchRemote often will freeze the server if you restart it after a while (a day or so).
Describe the bug If a server uses callRemote a lot, it seems that the memory it uses doesn't get freed up after waiting a long time.
To Reproduce Steps to reproduce the behavior:
<min_mta_version server="1.3.1"></min_mta_version>
to your runcode meta.xmlrun for i=1, 10000 do callRemote("a", 1, function() end) end
into server console and hit enterMTA Client/Server (please complete the following information):
Additional context From https://bugs.mtasa.com/view.php?id=7565