Memory leak with fieldpoint and labview
I have an application which is showing an issue of a memory leak. The application does several things, but the part that seems to be causing the trouble is related to use of Fieldpoint VIs. The application reads individual AI channels on a Fieldpoint AI-110 (10 channels, where the set of channels is measured once per second) I have attached the code related to this. The memory leak is quite large (~1.5GB in 24 hours of operation).
I am using LabView 7.1, and Fieldpoint 4.1. The parent application which uses the attached code is a stand-alone application. The operating system is Windows 2000. Fieldpoint communication occurs over a RS-232 link.
Thanks in advance,
Andy
Attachments:
FPAI100_meas_voltage.vi 62 KB
Hi Andy,
I did not see anything fundamentally wrong with what you wrote, but there were
a few things that I think could be used to be changed. However, there
were a few things that I did modify that might make a bit of a
difference. In your application you were using sequences and a bunch of
local variables. Since LabVIEW is based upon data flow, you can control
the sequence of execution by making data dependencies and simply wiring one
thing to the next. By simply using LabVIEW the way it is meant to run I
was able to completely remove the sequence structure and also eliminate the use
of all of the local variables, all while having the exact same execution order.
It could be that the local variables were causing the memory leak that you
noticed, but I really doubt they could be the cause of such a large leak.
I really think there is probably something else going on in the application
because from what I saw from this bit of code there really is no way that it
would have such large problems. Users use the FP commands daily without
any problems, so most likely these are not the root of the problem.
Go ahead and try the modified code and see if you can implement similar local
and global variable reducing techniques throughout your application.
Hopefully that will help reduce some of the memory leaks you are seeing.
Typically the largest cause of an apparent memory leak really occurs from
building an array within a loop, so make sure you don't have any situations
where that occurs in your code either.
Regards,
Otis
Training and Certification
Product Support Engineer
National Instruments
Attachments:
724727-FPAI100_meas_voltage.vi 56 KB
Similar Messages
-
Memory leak with jsp and beans
The application we have created has one particular page that is designed to stay up in the browser and refresh with new information from database queries once every 60 seconds. Running with Tomcat3.2.1 and IE5.5
The problem is that the memory usage of java.exe continues to grow until the machine crashes from out of memory. It does take more than 24 hours to crash.
Things I have tried to do to track down the problem or eliminate the problem.
- I have explicitly set the scope of the beans to "page"
- I have watched the DatabaseAccess.class (the beans are all extended from this class) and put in code to watch how many instantiations of the class are made and subsequently garbage collected. This appears to be where the memory leak may reside - hundreds of instantiations from some other source than the page I am displaying.
- the top frame makes database queries for security and display of a menu system dependant upon security clearance. It does not set any time for refresh (refresh == 0). Nor does it explicitly set a scope for the beans.
- I have run a different jsp engine to see if this was directly related to Tomcat - same problem with resin2.0.0
The main jsp page that is in the bottom section of the page has the following code:
** only the relevant lines are included here
<%@ include file="../../common.jsp" %>
<%
refresh=60;
%>
<head>
<%@ include file="../../meta_head.jsp" %>
</head>
<body bgcolor="#FFFFFF" text="#003399" link="#660099" vlink="#990099" alink="#006666" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%@ include file="../../access.jsp" %>
<%@ include file="../../page_title.jsp" %>
<jsp:useBean id="Line" class="jsp.Line" scope="page" />
<jsp:useBean id="Machine" class="jsp.Machine" scope="page"/>
<jsp:useBean id="Alarm_log" class="jsp.Alarm_log" scope="page"/>
contents of meta_head.jsp
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV= "expires" content = "0">
<META HTTP-EQUIV="Pragma" CONTENT="no_cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" forua="true">
<META NAME="robots" content="NOINDEX,NOFOLLOW">
<%
if (refresh > 0)
%>
<meta http-equiv="Refresh" content="<%= refresh %>">
<%
If anyone has some suggestions on how to trap this memory leak, it would be terrific. Or, some other things to try to stop the instantiation of the DatabaseAccess object (perhaps setting the scope of the beans in the header to "session" or "application"?).
Thanks in advance.
Robertajsp:useBean tags scope declaration :
page = Create a new instance on each load.
session = Load instance from the session, if not there, create one
application = Load instance from the ServletContext, if not there, create one.
Not sure how you are populating the data variables, but make sure you are closing all ResultSet, (Prepared)Statement, and Connection objects. -
Memory leaks with Njawin and COm Object
I'm using njawin 1.1 to use a DRM Microsoft object form java and all works
very well .... very good bridge !!
But I found a problem that seems like a "memory leak" in calling a method,
in this lines code :
myLicense = myLicenseObj.GetLicenseToDeliver();
System.out.println(myLicense);
myResponseObj.AddLicense("2.0.0.0", myLicense);
myResponseObj.setReplaceQuotesWith("\\\"");
myLicResponse = myResponseObj.GetLicenseResponse();
The only particularity in this code the length of myLicense string : 7 KB
If I run the program 1000 times the server use 100 Mb of ram and not release
them.
I try to use ASP to replicate the problem but nothing happens ... the
program works and not memory leak appears and than I think taht the probelm
may be in marshalling / unmarshalling string routine from/to the DRM object
Thanks a lot for all helpMe funciono colocando el progID de la interfaz que genero jawin en el constructor de la clase que se genero, despues utilice los metodos y fue transparente:
Interfaz que genero jawin:::
public interface CodeIMG {
public static final GUID clsID = new GUID("{23435XCVDF2-6D62-6749- 8E00-00AS45GH87JU}");
public static final String progID = new String("ActivexPDF.CodeIMG");
la clase que genero jawin:::::::
public class _CodeWER extends DispatchPtr {
public int getTypeInfoToken() {
return 0;
static public final GUID proxyIID = new GUID("{632PHK77-6F0B-11D4-8PLD-00A024A31CC6}");
static public final int iidToken;
static {
iidToken = IdentityManager.registerProxy(proxyIID, _CodeWER.class);
public int getGuidToken() {
return iidToken;
* Creates empty _CodeWER Object
public _CodeWER() throws COMException {
super();
* Creates _CodeWER() Object with progID
public _CodeWER()(String progid) throws COMException {
super(progid);
* Queries interface of _CodeWER Object
public _CodeWER()(IUnknown other) throws COMException {
super(other);
* Creates _CodeWER() Object with CLSID
public _CodeWER(GUID ClsID) throws COMException {
super(ClsID);
public boolean createImg(ObjectRef strChain, ObjectRef strFile) throws COMException {
return ((java.lang.Boolean) invokeN("createImg", new Object[]{strChain, strFile}, 2)).booleanValue();
Test de Prueba:::::::
public class TestDLL implements CodeIMG {
public static void main(String[] args) {
try {
CodeWER pdf = new CodeWER ( clsID );
boolean ok = pdf.createImg(new ObjectRef("9999999"), new ObjectRef("C:\\image.bmp") );
System.out.println("Lo generoi bien:: " + ok );
} catch (COMException e) {
e.printStackTrace();
Espero te sirva este ejemplito sencillo de jawin
Saludos!!!!!!!!!!!!
att juo -
How can I read two channels with fieldpoint and labview
I'm trying to read two or more channels with the TC 120, and I follow the examples of sopport page, but doesn't work.
What can I do?For more information about reading or writing to or from multiple channels in Fieldpoint, please refer to:
How Do I Read or Write to Multiple Channels on a Fieldpoint Module in LabVIEW?
This should enable you to read multiple channels. The only other option available is to use one fp open.vi, multiple Create Tag.vi's and multiple FP Tag Read.vi's. -
Memory leaks with Third party classes
Hello all,
This is fairly known problem. But I guess, my problem gives a new dimention to the problem.
I have an application which is developed by me. This application ideally needed to use third party classes ( obviously no source code is supplied ). These third party classes provide extra functionality required.
The problem is, when I don't use third party classes in my application, every thing is fine. When I include third party classes, I am having memory leaks.
Then I tried to investigate memory leaks with Optimizeit tool. It is new to me. As of now, I understood, we can identify where the memory leaks are occuring.
finally the problem is, in order to solve this, I need some patches in the code. But I don't have source code for those classes. How to solve this problem?
For example,
I use a third party classes in my code like this,
ThirdPartyMemoryLeakClass obj = new ThirdPartyMemoryLeakClass();
This 'obj' is made static, as it takes lot of time to create this object. Obviously this object contains several references to other objects, which I can't control.
In the process of reusing this object, I am getting memory leaks.
Any ideas regarding, how one has to deal this type of situations? What are the issues involved with this case? Are there any similar problems, which have been solved? are most welcome.
many thanks for your time.
MadhavDecompile it using jad. Find leak.Yes, I too got the idea and tried to decompile those classes and recompile. I had some problems while recompiling. Is this is the only way to get rid of this problem?
I was refering to powersoft.datawindow.DataStore class. Does any body here has worked on these?
Can you suggest me how to find the memory leak causes? if you were needed to find out memory leak causes, what would be your approach?
Madhav -
Memory leak with 1.6.0_07 in applet using Swing
Java Plug-in 1.6.0_07
Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
Windows XP - SP2
I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.I am Using Internet Explorer Browser Version 6.0.Huge security hole.
Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
Catch 'Throwable'. And log/display it somewhere. -
It seems there is a memory leak with JPopupMenu. The following program demonstrates this leak. If you run the program, click on show form, and then close the form, the used memory will be GCd appropriately. If you click on show form, then right click on the table to show the popup (even if you dont do anything else with the popup) then close the form, it never GCs the form. I've tried all kinds of crazy things, but I cant seem to find what is keeping the memory from being GCd.
Peter
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.beans.PropertyChangeListener;
import java.text.DecimalFormat;
import java.util.Timer;
import java.util.TimerTask;
import java.util.Vector;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
@SuppressWarnings("serial")
public class TriState extends JPanel {
private static final long K = 1024;
private static final long M = K * K;
private static final long G = M * K;
private static final long T = G * K;
protected static int ctr = 1;
private JButton btnShow = new JButton("Show Form");
private JLabel lblMem = new JLabel();
private static final DecimalFormat df = new DecimalFormat("#,##0.#");
protected Timer updateTimer = new Timer();
public TriState() {
this.setLayout(new GridLayout());
add(btnShow);
add(lblMem);
updateTimer.scheduleAtFixedRate(new UpdateTimerTask(), 1000, 1000);
btnShow.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FrmReferrals fr = new FrmReferrals();
fr.setVisible(true);
class UpdateTimerTask extends TimerTask {
public void run() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
dumpMemoryUsage();
protected void dumpMemoryUsage() {
System.gc();
Long t = Runtime.getRuntime().totalMemory();
long f = Runtime.getRuntime().freeMemory();
String st = convertToStringRepresentation(t);
String sf = convertToStringRepresentation(f);
String su = convertToStringRepresentation(t - f);
System.out.println("Total:" + st + "(" + t + ") Free:" + sf + "(" + f + ") Used:" + su + "(" + (t - f) + ")");
lblMem.setText(su + "/" + st);
public static String convertToStringRepresentation(final long value) {
final long[] dividers = new long[]{T, G, M, K, 1};
final String[] units = new String[]{"TB", "GB", "MB", "KB", "B"};
if (value < 1)
throw new IllegalArgumentException("Invalid file size: " + value);
String result = null;
for (int i = 0; i < dividers.length; i++) {
final long divider = dividers;
if (value >= divider) {
final double dr = divider > 1 ? (double) value / (double) divider : (double) value;
result = df.format(dr) + units[i];
break;
return result;
private static void createAndShowGUI() {
JFrame frame = new JFrame("SimpleTableDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create and set up the content pane.
TriState newContentPane = new TriState();
newContentPane.setOpaque(true); // content panes must be opaque
frame.setContentPane(newContentPane);
// Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
protected class PopupMenu extends JPopupMenu {
public PopupMenu() {
JRadioButtonMenuItem item1 = new JRadioButtonMenuItem(new AbstractAction("Insert Item") {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println(e.getActionCommand());
item1.setActionCommand("Insert");
add(item1);
JRadioButtonMenuItem item2 = new JRadioButtonMenuItem(new AbstractAction("Delete Item") {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println(e.getActionCommand());
item2.setActionCommand("Delete");
add(item2);
public class FrmReferrals extends JFrame {
public FrmReferrals() {
super();
init();
protected void init() {
jbInit();
protected void closeIt() {
uninit();
// variables here
protected Dimension dimPreferred = new Dimension(1270, 995);
protected JTabbedPane tabbedPane = new JTabbedPane();
protected JTable tblReferrals = null;
protected PopupMenu popMenu = new PopupMenu();
protected void jbInit() {
setPreferredSize(dimPreferred);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setTitle("Referrals");
JPanel pnl = new JPanel();
pnl.setOpaque(false);
pnl.setLayout(new BorderLayout());
pnl.add(tabbedPane, BorderLayout.CENTER);
// put it all in the frame
add(pnl);
pack();
setLocationRelativeTo(null);
// init the table and model
ReferralsTableModel ctm = new ReferralsTableModel(buildDummyVector());
tblReferrals = new JTable(ctm);
tblReferrals.setComponentPopupMenu(popMenu);
tblReferrals.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
tabbedPane.add(new JScrollPane(tblReferrals, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
addWindowListener(new WindowListener() {
@Override
public void windowActivated(WindowEvent e) {}
@Override
public void windowClosed(WindowEvent e) {}
@Override
public void windowClosing(WindowEvent e) {
closeIt();
@Override
public void windowDeactivated(WindowEvent e) {}
@Override
public void windowDeiconified(WindowEvent e) {}
@Override
public void windowIconified(WindowEvent e) {}
@Override
public void windowOpened(WindowEvent e) {}
protected Vector<DBO_Referrals> buildDummyVector() {
Vector<DBO_Referrals> vr = new Vector<DBO_Referrals>();
for (int x = 0; x < 5000; x++) {
DBO_Referrals r = new DBO_Referrals(x+(5000*ctr));
vr.add(r);
return vr;
protected void uninit() {
tblReferrals.setComponentPopupMenu(null);
for (Component c : popMenu.getComponents()) {
PropertyChangeListener[] pl = c.getPropertyChangeListeners();
for (PropertyChangeListener l : pl)
c.removePropertyChangeListener(l);
if (c instanceof JMenuItem) {
ActionListener [] al = ((JMenuItem)c).getActionListeners();
for (ActionListener l : al) {
((JMenuItem)c).removeActionListener(l);
popMenu = null;
protected class DBO_Referrals {
protected long id;
protected String Employee;
protected String Rep;
protected String Asst;
protected String Client;
protected String Dates;
protected String Status;
protected String Home;
public DBO_Referrals(long id) {
this.id = id;
Employee = "Employee" + id;
Rep = "Rep" + id;
Asst = "Asst" + id;
Client = "Client" + id;
Dates = "Dates" + id;
Status = "Status" + id;
Home = "Home" + id;
public long getId() {
return id;
public String getEmployee() {
return Employee;
public String getRep() {
return Rep;
public String getAsst() {
return Asst;
public String getClient() {
return Client;
public String getDates() {
return Dates;
public String getStatus() {
return Status;
public String getHome() {
return Home;
public class ReferralsTableModel extends AbstractTableModel {
protected Vector<DBO_Referrals> data = new Vector<DBO_Referrals>();
protected String[] sColumns = {"id", "Employee", "Rep", "Assistant", "Client", "Date", "Status", "Home", "R"};
public ReferralsTableModel() {
super();
public ReferralsTableModel(Vector<DBO_Referrals> data) {
this();
this.data = data;
@SuppressWarnings("unchecked")
@Override
public Class getColumnClass(int col) {
switch (col) {
case 0 :
return Long.class;
default :
return String.class;
@Override
public int getColumnCount() {
return sColumns.length;
@Override
public int getRowCount() {
return data.size();
@Override
public Object getValueAt(int row, int col) {
if (row > data.size())
return null;
DBO_Referrals a = data.get(row);
switch (col) {
case 0 :
return a.getId();
case 1 :
return a.getEmployee();
case 2 :
return a.getRep();
case 3 :
return a.getAsst();
case 4 :
return a.getClient();
case 5 :
return a.getDates();
case 6 :
return a.getStatus();
case 7 :
return a.getHome();
case 8 :
return "+";
default :
return null;BTW instead of continually printing out the memory use a profiler (jvisualvm in the jdk/bin directory -> heapdump -> search on your class -> view in instances -> find nearest GC root).
Looks like BasicPopupMenuUI doesn't remove a reference to the JRootPane immediately. As far as I can see it will be removed when another menu shows.
As a hackish workaround you can try this in you FrmReferrals#uninit():
for(ChangeListener listener : MenuSelectionManager.defaultManager().getChangeListeners()) {
if (listener.getClass().getName().contains("MenuKeyboardHelper")) {
try {
Field field = listener.getClass().getDeclaredField("menuInputMap");
field.setAccessible(true);
field.set(listener, null);
} catch (Exception e) {
// ignored
break;
}Funnily enough though it isn't there when I reduce your code to a SSCCE:
import java.awt.*;
import javax.swing.*;
public class TestBasicPopupMenuUILeak extends JFrame {
public TestBasicPopupMenuUILeak() {
super("Not collected right away");
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.getContentPane().add(
new JButton(new AbstractAction("Show frame") {
@Override
public void actionPerformed(ActionEvent e) {
EventQueue.invokeLater(new Runnable() {
public void run() {
JLabel label = new JLabel(
"Right click to show popup, then close this frame."
+ "The frame with not be GCed until another (popup) menu is shown.");
JPopupMenu popup = new JPopupMenu(
"Popup");
popup.add("Item");
label.setComponentPopupMenu(popup);
// named differently so you can find it
// easily in your favorite profiler
JFrame frame = new TestBasicPopupMenuUILeak();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.getContentPane().add(label);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
} -
Still memory leaks with 10.8.4
I hoped 10.8.4 could solve the issue..
Unfortunately I still have memory leaks, pages out and inactive memory full for a lot of programs running. First of all FCX importing and transcoding full the inactive memory, and OSX slows down, swapping to the SSD. The same problem with all (4 in total) macs mounting ML.
Has anyone solved the problem please?
Thanks in advance.
AttilioAttilio, although I'm not a Final Cut user, I suspect that your problem is, as Kappy first said - insufficient RAM.
See: http://forums.macrumors.com/showthread.php?t=1332888 for instance.
It's a RAM hog. With the Retina, you're stuck with the RAM you've got now, unfortunately. With any other hardware, I'd consider boosting the RAM as much as you can. I don't run FCX or any video editing software (I build web sites - so I use Dreamweaver, Photoshop, Lightroom etc.) and I boosted the RAM in my Mac Pro to 18GB quite a while ago because I was seeing a lot of pageouts and slowdowns with 10GB. I do tend to have a ton of windows and apps open at once.
See also: https://discussions.apple.com/thread/4759586?start=0&tstart=0 - Kappy's very good explanation of memory usage and various links to check.
Whether it appeared to run better in SL or not, I can't really say - unless you ran two identical Macs, side by side doing exactly the same things in FCX with the two operating systems installed, I don't know how one could accurately assess that. -
BasicTx and BasicRx daughter boards compatibility with USRP2920 and LabView
I want to know that BasicTx and Basic Rx daughter boards from Ettus research are compatible with USRP2920 and Labview or not.
Also do these boards supports variable gain or not? Please confirm
Thanks
JK
Solved!
Go to Solution.They will work but you need to use property nodes to configure them. Ther is no LO so ther is no center frequency parameter. I and Q are separate channels so you will need to break them apart and treat them as such. There is no gain because the boards essentially provide access to the ADC.
-
Memory leak with UI automation
Hi,
I noticed there is memory leak with UI automation in my window 8.1.
I noticed there is solution for window 8
http://support.microsoft.com/kb/2885482
Is there any solution for window 8.1?
I really appreciate for any help.Hi,
I'm sorry for didn't hear anything about this issue. I'll try to connect the writer of this KB, hope we can find some suggestion. If there is any progress about this problem, I would come back.
Roger Lu
TechNet Community Support -
Possible causes for memory leak in Java and Tomcat
I would like to enquire what are the typical mistakes done by programmers that will cause memory leak in Java and Tomcat.
Please refer the below site. It will give more points about the memory leak and how to rectify it.
http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Q_20981562.html?cid=336 -
How to solve the error "The specified resource is reserved" when running with DAQmx And LabVIEW?
I hate "J term"
OK I love the learning the students get. And, I like helping them out! But, as a former man who's got the varicose viens to prove he's spent time "behind the podium" (yeah, "behind the podium" puts 'em to sleep- songs and dances for the young'uns) come on! USE the tools you teach!
Instructors invited to engage in the forums
Jeff -
How can i detect "Memory leak" with large LabVIEW projects.
Hi,
I have a huge LabVIEW application that runs out of memory after running continuously for some time. I am not able to find out the VI that is hogging up memory. Is there any tool that dynamically detects the VI that is leaking memory.
Or, is there a tool or a way to identify the critical areas which can be potential culprits that is leaking memory.
Regards
BharathBdev wrote:
Thanks Dennis.
I think Desktop Execution toolkit should solve the problem.
Wayne Wrote
Have you tried Tools»Profile»Performance and Memory ? http://zone.ni.com/reference/en-XX/help/371361F-01/lvdialog/profile/
But this will just give me the amount of memory used by the VIs and not the amount of memory that is not getting released.
And where is the problem about that? Just try to find what VIs keep increasing in memory size. That are the culprits. If you have real memory leaks, meaning there is memory that is not managed by LabVIEW directly but for instance by a DLL somewhere and that DLL looses references to memory, so it goes really lost, then the only way to find that is by successively exclude functionality in your application until you can find the culprit.
There is no other simple way to find out about who is loosing memory references than by doing debugging by exclusion until the problem disappears. The only way to speed this up, which quite often works for me is doing an educated guess, about what components are most likely to do this misbehaviour.
Not knowing anything about your application and if you are talking about memory hogs (fairly easily identifiable by the mentioned Performance and Memory monitor) or actual memory leaks, it is hard to tell how to go about it. Memory hogs are usually the first thing I suspect escpecially with software I inherit somehow from people from whom I'm not sure they know all the ins and outs of LabVIEW programming.
If a leak seems likely the first culprit usually are custom DLLs (yes even DLLs I have written myself), then NI DLLs such as DAQmx, etc. and last there come leaks in LabVIEW itself. This last category is very seldom but it has happened to me. However before going to scream about LabVIEW having a memory leak you really, really should make sure you have very intensivly researched all the other possibilities. The chance that you run into a memory leak in LabVIEW, while not impossible, is so small compared to the other ways of causing either a memory hog or running into a leak in an external component to LabVIEW, that in 99.9% of the cases where someone screams about a LabVIEW memory leak, he is simply wrong.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
i am using fieldpoint 2.0 and labview 6i to monitor my system, but i think i don't have labview DSC.
I have written a relatively large Fieldpoint application "just" using LV5.1 FDS, so it can be done.
Fieldpoint can be seen as an external instrument, so you need to use the driver/vi's that comes with FP.
I believe using DSC would only make the job easier for you. -
Memory leak with large files and this code?
Okay, so the following code will not complete.
Basically what I am doing is opening 5 files and generating a PDF document from the already opened Report file, which is renewed prior to the PDF export operation. I left out the general stuff at the start. I am also writing out the location of the PDF to a HTML file, which acts as an index of the exported PDF documents.
I believe it is due to some sort of memory leak issue, but it could be something else or just my code. I have not stepped through this code, but for small file sizes of say less than 40 megs per file, it works fine. For file sizes along these lines:
File 1 = 230 megs
File 2,3 = 26 megs
File 4,5 = 8 megs
it will belch erors at the end of about the 5th iteration through the For loop. It will complete the 5th iteration however. Here are the errors generated:
84 10/26/2006 9:35:15 AM Error:
85 File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p1.TDM" file is invalid.
(Error no. 6)
86 10/26/2006 9:40:19 AM Error:
87 File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p2.TDM" file is invalid.
(Error no. 6)
88 10/26/2006 9:45:17 AM Error:
89 File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p3.TDM" file is invalid.
(Error no. 6)
90 10/26/2006 9:53:07 AM Error:
91 File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p8.TDM" file is invalid.
(Error no. 6)
92 10/26/2006 10:00:39 AM Error:
93 File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p9.TDM" file is invalid.
(Error no. 6)
94 10/26/2006 10:01:01 AM Error:Error occured during file creation.
95 10/26/2006 10:01:01 AM Error:
Error in <GM315 Pa...sing.VBS> (Line: 185, Column: 5):
File handle for "W:\TR-2051-2100\TR-2060 - BAS Arctic PTC\Vnom\00-99\VnomCombined00-99\p1.TDM" file is invalid.
(Error no. 6)
For files of a larger size, like:
File 1 = 7500 megs
File 2,3 = 80 megs
File 4,5 = 25 megs
This occurs after about 2-3 iterations through the loop.
see attachment for code.
Attachments:
ForLoopCode.txt 11 KBi am having a similar error randomly inserted in the log
25 10/1/2009 1:58:36 PM Error:
26 File handle for "C:\Program Files\Summitek\Spartan\data\tdm\S Parameter Test $SSN$ 49.TDMS" file is invalid.
(Error no. 6)
and
31 10/1/2009 1:58:37 PM Error:
32 File handle for "C:\Program Files\Summitek\Spartan\www\temp\Test_$SSN$ 49_602313172.pdf" file is invalid.
(Error no. 6)
it doesn't seem to be causing an immediate problem, but i have had several unexplained Diadem lockups.
they occur in log after i use CALL DATAFILELOADSEL and CALL PICpdfexport
help? what does this mean
jim
Maybe you are looking for
-
How do I use the a command from a .dll with labview?
I want to use for example the M8784Open() command to control an M8784 photon counter. I know how to place a call library function node but don't know where to go there. The user manual for the photon counter has the following explanation of the M878
-
Heat/fan issue while gaming?
I got my macbook in Feb 2012, I have never gamed on any computer before so I am not sure how this issue is comparable to other types of laptops. The macbook does get hot like any laptop if left on for too long or if it is running more "in-depth" prog
-
HT4623 is there anyway to retrieve photos that were erased after update
when updated the new IOS Softwear when it was done all of my pictures were gone be my text were still in my messaging. is there any way to get the pictures back?
-
Co-existance with 1.x and 3.x Calendar Servers
My Calendar Server 1.x nodes aren't working with my 3.5 nodes. Why? <p> Coexisting with Calendar 1.x nodes Coexisting with Calendar 3.x nodes Coexisting with Calendar 1.x nodes 1.Backup all the Calendar Server 1.0x hosts. 2.Migrate or install the Cal
-
Networking issues following upgrade to 10.5.8 when iMac wakes from sleep
Hello, I recently upgraded to 10.5.8 and I'm now experiencing issues with network connectivity following the iMac waking from sleep. I have to stop Airport and then start it again to resolve the issue. Can you provide any resolutions to this or advic