• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Do unit order events leak somehow ?

Status
Not open for further replies.
Level 3
Joined
Apr 15, 2019
Messages
24
Hello, sorry if my english is bad


I put this code to my map:


JASS:
function time takes nothing returns nothing
local integer i =  0
loop
exitwhen i ==100
call IssueImmediateOrderById  ( udg_u  , 851972 )
set i = i+1
endloop
endfunction



function start takes nothing returns nothing
local trigger t = CreateTrigger()
set udg_u = CreateUnit (Player(0) , 'hfoo' ,  0,0, 90 )
call TriggerRegisterUnitEvent (t , udg_u , EVENT_UNIT_ISSUED_ORDER )
call TimerStart ( CreateTimer(),  0.03,  true  , function time )
endfunction


It just creates 1 footman, and orders him to STOP many times per second, there is also a trigger with unit order event and no condition and actions


After I activate it ( call start() ) , my computer memory begins to go up pretty quickly, end eventually game crashes. There is nothing else on the map, no triggers, no code, no units, nothing


Can anyone explain please ?



EDIT:

My point is, this simple trigger:

  • order
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions

apparently leaks, if I order my units to stop alot. (( If I dont create this empty trigger, leak doesnt happen.

That jass script in my 1st post was to quickly test this.

Can anyone please do some tests too ? To confirm / deny.
 
Last edited:
You are creating an endless loop.
You order the unit to do something, your loop fires, you order your unit again and it will cause another 100 iterations.
The trigger runs, but it's an empty trigger. Issuing an order doesn't run the time() funcion in an infinite loop, but the time() function runs only by the periodic timer.
 
Level 23
Joined
Apr 3, 2018
Messages
460
You are giving the stop order 3333 times per second.
When a unit is ordered to stop, doesn't it immediately begin to search for a target to attack?
May be that's what is taking up memory.
Or it could be creating-deleting order queues which probably also take memory, and may be they are not immediately released.
 
The trigger runs, but it's an empty trigger. Issuing an order doesn't run the time() funcion in an infinite loop, but the time() function runs only by the periodic timer.
He modified his post after my reply.

~~He only had a JASS script before with a trigger that listens on unit orders with a loop that runs 100 times and orders the same unit to do another order.~~ nvm, read his script wrong.

What Patch are you on OP?
Can you run your empty GUI trigger 10000 times and check memory before and after?
 
Level 3
Joined
Apr 15, 2019
Messages
24
What Patch are you on OP?
Can you run your empty GUI trigger 10000 times and check memory before and after?


Firing the trigger 10000 times (by doing 10000 orders) increases the memory by approximately 3 MB. Well , not a lot. But in a long game with a lot of players with high apm and units, it can eat quite a lot of memory, I guess. I am making custom movement/casting system, so I really need this trigger which catches all orders.


What Patch are you on OP?


Well I actually dont have access to latest patch yet. I tried on 1.26 , 1.29 , 1.31 ptr . Each patch has the leak.



You are giving the stop order 3333 times per second.
When a unit is ordered to stop, doesn't it immediately begin to search for a target to attack?
May be that's what is taking up memory.
Or it could be creating-deleting order queues which probably also take memory, and may be they are not immediately released.

It seems that just spamming orders doesnt cause any trouble. But when I create a trigger which catches those orders, it begins to eat memory, even if the trigger is without conditions or actions.
 
Last edited:
Status
Not open for further replies.
Top