NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
calvintiger
Posts: 33
0 Kudos

Unduly high memory usage of Mathscript nodes

After a few "Not enough memory" errors in my Labview program, I decided to investigate in order to find out what part of the program was being too memory-hungry.
I finally traced this issue to a sub-VI of mine that uses a Mathscript node. The node in question was using 500 MB (!) of RAM to generate a few arrays whose total size shouldn't have been more than a few 10's of MB.

I ran some tests and noticed that the Mathscript node seems to use too much memory even for simple operations. I don't have precise figures here, but it I had the impression that it wasn't too good at clearing unused variables during the script. Furthermore, using the "clear" command manually (as used in Matlab) leads to silly errors when executing the VI.

I solved the problem by trading my Mathscript node for a Matlab Script node (which calls Matlab through an ActiveX call), and Matlab does the job nicely and quickly without any error (even though I admit that I don't know how much memory Matlab itself used for this, but it didn't seem to burden the PC too much).

This leads to the question: Are Mathscript nodes notoriously memory-hungry, and if yes is there a way around this ? (I admit that they are quite useful, or at least they would be without this issue). If not, what mistake could I have committed ?

Member
K_Scott
Posts: 39
0 Kudos

Re: Unduly high memory usage of Mathscript nodes

[ Edited ]

Hi calvintiger,

 

Would you be willing to post your VI with some useful initial data so that we might investigate this issue? Alternatively, you could pm me for an address to send it via email if you wish to keep it private. Also, what versions of LabVIEW and MathScript are you using?

 

Thanks,

 

K Scott

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page