Proof of Leaks

*missingFile

New Member
Reaction score
0
Well, I was thinking “hey, you shouldn't believe everything you read” and then I realized I wanted to know something: how do we know leaks are real?

At first, I considered the following example of proof:
JASS:
function InitTrig_DynamicTriggerKing takes nothing returns nothing
    local trigger t=CreateTrigger()
    set t=null
endfunction

Alright, I created a trigger, that's taking memory from Warcraft III, right? So the idea is [LJASS]DestroyTrigger[/LJASS] will remove it from memory and “clear” the leak. But how do we know that Warcraft III doesn't fail some how and keep the memory anyways?

How do we really know anything about how Warcraft III uses memory? Was it reverse–engineered or did other programmers apply real programming knowledge on Warcraft III?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
For sure, it will leak, as you didn't destroy it.
Null is just make the pointer value-less, but the handle didn't being destroyed.
 

Sevion

The DIY Ninja
Reaction score
413
We know it's a leak because if you open your Task Manager and check the memory usage, it continues to increase without decreasing if you create leaks. There's a reason everyone believes in leaks. It's because they exist.
 

emjlr3

Change can be a good thing
Reaction score
395
We know it's a leak because if you open your Task Manager and check the memory usage, it continues to increase without decreasing if you create leaks. There's a reason everyone believes in leaks. It's because they exist.

QFT

some few know exactly how much things leak too (how much memory that is)
 

Sevion

The DIY Ninja
Reaction score
413
I read somewhere how much each thing leaked, but that didn't interest me too much so I didn't bother memorizing the values.
 

Risen

New Member
Reaction score
4
I think after the 20,000th leak you start to notice your FPS dropping.

Well, for most people.
 

Romek

Super Moderator
Reaction score
963
> I think after the 20,000th leak you start to notice your FPS dropping.
It depends on how many other handles you have. Leaks are just undestroyed handles without reference.

If you want clearer proof without Task Manager, use GetHandleId() on a newly created handle and see how high the index is.

It's obvious that undestroyed handles will take up memory. The whole 'nulling' business is because of a bug in WC3 which essentially prevents the recycling of a destroyed handle if a local is pointing at it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top