cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Out of Memory Error

ptc-2979242
1-Visitor

Out of Memory Error

Hi, I'm having problems with Mathcad 14 M020 (apart form the other faults) handling memory. One worksheet I'm using (giving no problem whatsoever in Mathcad 2000) is read and computed the first time around and then, shortly after I start adding calcs to it Mathcad gives an Out of Memory message and the only way out is by killing it (and loosing all the updated bits). The worksheet is fairly complex and has a number of 3D graphs in it but it isn't hugely so, as I've created more complex worksheets in the past handling fairly larger ammount of data. I can always disable evaluation of the 3d Graphs, which always helps but is there a way to handle this bug or get a better memory amanagement from MathCAD 14? By the way, I'm using a 2 GB laptop and Vista 32 SP2. Thanks for any help Andrea
6 REPLIES 6
RichardJ
19-Tanzanite
(To:ptc-2979242)

Are you using symbolic calculations, and specifically, are you using symbolic definite integrals? Richard

"Richard Jackson" wrote:

Are you using symbolic calculations, and specifically, are you using symbolic definite integrals? Richard

RichardJ
19-Tanzanite
(To:ptc-2979242)

Then all you can do is try to manage the memory better, which means understanding how Mathcad stores data and intermediate results. First, Mathcad is based on .NET, so when it needs a chunk of memory to store a matrix, that memory needs to be contiguous. So if you have big matrices, try and assign them earlier in the worksheet rather than later. Second, if you assign a matrix, say M, in a Mathcad worksheet, then do some calculations with it, and then reassign the matrix M lower down the worksheet, the two copies of M are different. The second assignment does NOT overwrite the first, because the first assignment is still needed by Mathcad for the calculations higher up the worksheet. Every time the contents of a worksheet variable are "changed", whether by assignment or calculation, a new copy of that variable is created (so they are not actually variables at all, they are constants, and their contents do not change). While this is true of variables at the worksheet level, it is not true of local variables in programs. The memory associated with a local variable in a program is freed as soon as the program exits. So try to keep the number of places where large arrays are created (either by assignment or calculation) at the worksheet level to a minimum. Put all the intermediate calculations you can in a program. Also try to minimize the number of steps in calculations at the worksheet level. A=B*C followed by D=A+E takes more memory than D=B*C+E. Richard

"Richard Jackson" wrote:

Then all you can do is try to manage the memory better, which means understanding how Mathcad stores data and intermediate results. First, Mathcad is based on .NET, so when it needs a chunk of memory to store a matrix, that memory needs to be contiguous. So if you have big matrices, try and assign them earlier in the worksheet rather than later. Second, if you assign a matrix, say M, in a Mathcad worksheet, then do some calculations with it, and then reassign the matrix M lower down the worksheet, the two copies of M are different. The second assignment does NOT overwrite the first, because the first assignment is still needed by Mathcad for the calculations higher up the worksheet. Every time the contents of a worksheet variable are "changed", whether by assignment or calculation, a new copy of that variable is created (so they are not actually variables at all, they are constants, and their contents do not change). While this is true of variables at the worksheet level, it is not true of local variables in programs. The memory associated with a local variable in a program is freed as soon as the program exits. So try to keep the number of places where large arrays are created (either by assignment or calculation) at the worksheet level to a minimum. Put all the intermediate calculations you can in a program. Also try to minimize the number of steps in calculations at the worksheet level. A=B*C followed by D=A+E takes more memory than D=B*C+E. Richard

RichardJ
19-Tanzanite
(To:ptc-2979242)

"andrea tasselli" wrote:

All these things I normally do although sometime (and this time) the end product of the calcs are the matrices themselves so there is no avoiding that. This, however, does not explain why the program won't let you gracefully exit

PTC technican told me that MathCAD 14 M020 has a serious memory leak problem. It is also limited to 1 GB or maybe 2 GB in memory for computation.
Announcements

Top Tags