Re: Question about memory consumption in my codes by using Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg80841] Re: Question about memory consumption in my codes by using Mathematica
- From: foxvexon <yulinwei at gmail.com>
- Date: Tue, 4 Sep 2007 03:39:41 -0400 (EDT)
- References: <f9s47u$ao7$1@smc.vnet.net><f9udns$ar5$1@smc.vnet.net>
Thank you very much for your suggestion! But I wonder whether it is necessary to do so in Mathematica? Why Module[] can not handle the memory as effectively as Block[]? Maybe, I should read more carefully the reference. Thanks again! On Aug 15, 4:33 pm, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de> wrote: > Hi, > > try Block[] instead of Module[] .. > > Regards > Jens > > > > foxvexonwrote: > > I write a routine that repeats loading and treating a large amount of > > data imported from external data files produced by another program. I > > enclose codes for this task in a simple Module[{local_vars}, > > expressions]. Of'cause, it calls pre-defined routines outside but does > > not introduce any new variable except temple local ones. > > > I am confused that If this is done for just one or two loops/times, it > > works well. But if I hope to run this loop several times, like 10~200, > > Mathematica usually reports memory consumed out and terminates > > automatically. > > > I check my codes over and over to make sure that I do not introduce > > new variables in each loop that will eat up memory every time. But, I > > do notice (from windows task manager) that the used memory by > > Mathematica 6 is increasing with each loop. > > > Please help! Thanks a lot in advance!- Hide quoted text - > > - Show quoted text -