MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Compile + Module => Memory Leak

  • To: mathgroup at
  • Subject: [mg39939] Re: Compile + Module => Memory Leak
  • From: Bill Rowe <listuser at>
  • Date: Wed, 12 Mar 2003 02:31:33 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 3/11/03 at 2:37 AM, bgress at (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.

  • Prev by Date: Re: GraphicsArray question
  • Next by Date: Right-click'd BMP vs. exported BMP
  • Previous by thread: Compile + Module => Memory Leak
  • Next by thread: Re: Compile + Module => Memory Leak