Module, DynamicModule & MemoryInUse
- To: mathgroup at smc.vnet.net
- Subject: [mg107686] Module, DynamicModule & MemoryInUse
- From: Ariel Sepulveda <sepulveda.cuevas at gmail.com>
- 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}];
DynamicModule[{d1},
d1 := data[[1]];
Panel[Grid[{{memBefore}, {mu}}]]
, UnsavedVariables -> {dl}
]
];
memModule[]
memModule[]
memModule[]
Your support will be appreciated,
--
Ariel Sepulveda, Ph.D.
__________________________
President, Pronto Analytics Inc.
Tel. 787.354.6947
ariel.sepulveda at prontoanalytics.com
http://www.prontoanalytics.com
- Follow-Ups:
- Re: Module, DynamicModule & MemoryInUse
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Module, DynamicModule & MemoryInUse