It causes a leak when u use it more than once and it takes up unnecessary memory when u have them set for so long
This is bullshit. Please don't spread this.
A leak is caused when you create an object variable that is never used again without destroying it afterwards. It doesn't matter how long an object variable exists or how often it is used, as long as you can still access and use it again.
Since a lot of people seem to post here that spread dangerous semi-knowledge, here's the facts:
- the OP limit can only be reached inside
one single thread. Some GUI functions open up seperate threads (group/force enumerations, waits, conditional waits - and all triggers will run on a different thread!), so that the amount of operations per trigger can be much larger
- the OP limit has
nothing to do with the size of your map or the amount of variables and triggers; only object arrays with an initial value might hit the OP limit at variable declaration - but its very unlikely. Removing random stuff in your map just because you think your map is too big won't change anything
- Some functions take up more operation time as others, causing the OP-limit to be reached faster. Variable setters for example are fast as hell whereas you are much likely to hit the OP limit when creating THOUSANDS of units (quite literally, you won't hit the OP limit with just a couple of hundrets - however, that doesn't mean the trigger will not lag when creating so many units
)
- When the OP-limit is reached, it doesn't mean that the whole trigger doesn't execute - it does execute up to the point the OP-limit is reached and then simply stops, which means that everything up to this point should still be happening in your map
- Leaks are a totally different thing and have
no impact on reaching the OP limit or causing triggers to not execute at all - while leaks can have an impact on decreasing performance of your map, they will never crash/terminate or stop threads
- If you are unsure about leaks, read tutorials about them to avoid them whenever possible
I'm still pretty sure that your problem is NOT the op limit. Again: it doesn't matter how many variables or triggers you have in your map. Only the number of functions inside one trigger execution matters.
If you still think its the OP-limit, put in test messages in all your longer triggers. If you can't read all the messages after the map starts, you know the culprit and can post the specific trigger in this thread so that we can debug it or validate its indeed the OP-limit (which I still doubt it is).