[Date Index] [Thread Index] [Author Index]
Re: Compile + Module => Memory Leak
On 3/11/03 at 2:37 AM, bgress at mail.DOTucr.DOT.edu (Bern) wrote: [example snipped] >Presumably, upon exit, a Module should release any memory used, no? No, I don't believe this is the way Mathematica deals with memory. My understanding is Mathematica releases memory that is no longer needed as determined by whether there are expressions that reference that memory. Once all of the expressions that reference a piece of memory are deleted the referenced memory is released. In the code you posted (that I snipped) the Module construct creates symbolic references. The code does not delete the created symbols. As far as I know, neither Module nor Block deletes symbols created unless you write code to specifically do this. Since the symbols are not specifically deleted, the memory these symbols reference is not released.