MathGroup Archive 2010

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

Search the Archive

Module, DynamicModule & MemoryInUse

  • To: mathgroup at
  • Subject: [mg107686] Module, DynamicModule & MemoryInUse
  • From: Ariel Sepulveda <sepulveda.cuevas at>
  • Date: Mon, 22 Feb 2010 19:05:36 -0500 (EST)

The following example has been created for showing a memory issue related to
Module and DynamicModule.  Everytime memModule[] is executed the memory in
use increments.  My question is, is there a way to avoid this unwanted
increment in MemoryInUse?  I need data to be a local variable in the
external module and d1 to be a local variable in the DynamicModule.  Note
that pressing Ctrl+Shift+E shows that data is not part of the saved
expression in the DynamicModule output, thus I don't understand why the
memory keeps increasing.

memModule[] :=
 Module[{data, memBefore, mu},
  mu := Grid[{{"Memory in use: ", MemoryInUse[]/(2^30.), "GB"}}];
  memBefore = mu;
  data = RandomReal[1, {300000, 20}];
   d1 := data[[1]];
   Panel[Grid[{{memBefore}, {mu}}]]
   , UnsavedVariables -> {dl}

Your support will be appreciated,

Ariel Sepulveda, Ph.D.
President, Pronto Analytics Inc.
Tel. 787.354.6947
ariel.sepulveda at

  • Prev by Date: Re: Handheld mathematica
  • Next by Date: Re: Exporting interactive 3D objects from Mathematica to PDF documents
  • Previous by thread: Re: ? about MatrixPlot used with ListPlot
  • Next by thread: Re: Module, DynamicModule & MemoryInUse