Thread: Memory Leak
View Single Post
05-28-09, 09:58 PM   #20
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
Originally Posted by Vyper View Post
This is where we run into differences between programmers and laypersons. To a layperson, not knowing what is going on behind the scenes, any problem in which memory grows is a "memory leak"
To a programmer however, a memory leak is a very specific problem, which cannot occur in garbage collected languages like Lua. To a programmer, a memory leak is when the program loses the reference to an object in memory, before it has returned that memory to the system. Thus, the program still has that memory allocated, even though it cannot get at it. Thus it is lost, or "leaked".
Garbage collected languages such as Lua, detect when there are no more references to an object in memory, and returns that memory to the system on behalf of the program, making a true memory leak impossible.
Programs in Lua, can still suffer from "memory bloat", in which a reference to the memory is maintained when it shouldn't be, preventing it from being garbage collected.
Key Difference:
Memory Leak: Program and Operating System do not have access to the memory
Memory Bloat: Program still has access, but doesn't need it any more.

While the symptoms are similar they are usually caused by very different programming mistakes, so while to the user the difference is kind of irrelevant, to a programmer it does make a difference.

That said it sounds like they both probably define a function of the same name in the global name space, probably for recycling tables or something similar, causing the conflict.
Thank you
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!