MathGroup Archive 2011

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

Search the Archive

Windows possible memory leak

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120612] Windows possible memory leak
  • From: "McHale, Paul" <Paul.McHale at excelitas.com>
  • Date: Sun, 31 Jul 2011 07:24:56 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

I wanted to compare rules based processing performance to Table[] based processing performance.  The following code section assumes the data was read in and certain variables are set.  I executed the same code about 10 times in a row to get the output formatted and the comments/coding the way I wanted to leave it.  I don't believe this code creates more data every time it is executed.  I could be wrong.  I believe the first time it is run, variables are created.  Each subsequent run overwrites the variables.

How do I end up with the "Out of memory" error?  I should be able to "Shift-Enter" this all day long.  I didn't lose anything.  I just needed to reload certain data.  It isn't just this code.  It has happened many times before on other code.  If I am doing something wrong, let me know so I can mend my ways :)  Otherwise, I am inclined to believe there is some memory management (or setting?) issue.  Running the same code over and over again should yield the same results (memory wise ;) )


(*  Perform rule based processing  *)
RuleStartTime=Date[];
mListRule=InData /. {AA_,BB_,CC_,DD_,EE_,FF_} -> {
{AA*mTimeCal,DD*mDivideBy*Calibration[[3]][[1]]+Calibration[[3]][[2]]},
{AA*mTimeCal,EE*mDivideBy*Calibration[[4]][[1]]+Calibration[[4]][[2]]},{AA*mTimeCal,FF*mDivideBy*Calibration[[5]][[1]]+Calibration[[5]][[2]]}};
RuleStopTime=Date[];
"Rule based processing time: "<> ToString @ DateDifference[RuleStartTime,RuleStopTime,"Second"]

(*  Perform Table[] based processing  *)
TableStartTime=Date[];
mData=Table[
{{InData[[i,1]]*mTimeCal,InData[[i,4]]*mDivideBy*Calibration[[3]][[1]]+Calibration[[3]][[2]]},{InData[[i,1]]*mTimeCal,InData[[i,5]]*mDivideBy*Calibration[[4]][[1]]+Calibration[[4]][[2]]},{InData[[i,1]]*mTimeCal,InData[[i,6]]*mDivideBy*Calibration[[5]][[1]]+Calibration[[5]][[2]]}},
{i,1,Length[InData]}
];
TableStopTime=Date[];
"Table based processing time: "<> ToString @ DateDifference[TableStartTime,TableStopTime,"Second"]

(* Compare the two results *)
"Comnparing the two results mListRule ==  mData -> " <> ToString @ (mListRule==  mData)

Rule based processing time: {3.01541, Second}
Table based processing time: {1.29678, Second}
Comnparing the two results mListRule ==  mData -> True


Thanks,
Paul





Paul McHale  |  Electrical Engineer, Energetics Systems  |  Excelitas Technologies Corp.

Phone:   +1 937.865.3004   |   Fax:  +1 937.865.5170   |   Mobile:   +1 937.371.2828
1100 Vanguard Blvd, Miamisburg, Ohio 45342-0312 USA
Paul.McHale at Excelitas.com<mailto:Paul.McHale at perkinelmer.com>
www.excelitas.com<http://www.excelitas.com>

[cid:image001.png at 01CB9136.E3D96D90]

Please consider the environment before printing this e-mail.
This email message and any attachments are confidential and proprietary to Excelitas Technologies Corp. If you are not the intended recipient of this message, please inform the sender by replying to this email or sending a message to the sender and destroy the message and any attachments.
Thank you




  • Prev by Date: Re: Mathematica 8 remote parallel kernels
  • Next by Date: Re: Cumulative probability question
  • Previous by thread: Performance under Lion
  • Next by thread: Re: special iterator