06-25-2009 04:37 AM
I have memory leaks in my Labview application connecting and inserting data into a MSSQL server using Labview Database Toolkit.
Versions: Labview 7.1, Toolkit 1.0.1.
I have searched the forums and searhed everywhere else...I see there are some issues. (For example List tables vi). Removing the list tables vi helped a lot. But I can still see that I'm loosing memory here and there, now and then.
My question is: Is there any general guidlines to prevent all memory leaks mentioned?
Or possibly, will it all go away if I upgrade the versions. (As I understand I have too update Labview to be able to update the Toolkit?)
Best Regards
/Jesper
Solved! Go to Solution.
06-25-2009 06:22 AM
Have you seen this Developer Zone document?
LabVIEW Database Connectivity Toolset 1.0.1 Known Issues
Functions, VIs, and Express VIs - ID 2F7E2352
Memory Leak in the Database Toolset in DB Tools Open Schema VI
The DB Tools Open Schema VI leaks memory which if called continuously eventually causes a LabVIEW crash. This is a sub VI of the DB Tools Insert Data VI.
Workaround—At the highest level, if you are continuously updating values in a table, make sure the table already exists and leave the Create Table input to the DB Tools Insert Data VI set to FALSE.
Other than this, the most important thing is to close all references...
06-25-2009 07:44 AM
Yes, I have seen it. The only thing I think applies to my case is the DB Tools Open Schema issue.
That vi is completely removed from my application. But I still see some leaks. (A lot less though! Maybe it is too little to worry about, but it is always hard to tell when you have a customer application running 24 h a day for months and months.)
I also have a 100 times larger labview application running on the same PC that does NOT have any leaks at all, thats why I am pretty sure it has something to do with the DB toolkit. It could of course also be something with the ODBC stuff....
About closing references.
1. I open a connection reference with Open Connection
2. Then I use Execute Query, always followed by Free Object to work on the database.
3. On connection errors, I first use Close Connection and then start over from top.
Am I missing something with the references in the above example? Is Free Object the correct vi to use for closing the recordset reference after a Execute Query?
Regards
/Jesper
06-25-2009 12:00 PM
There is a small amount of memory allocated everytime you do an "open". If you are opening repetedly that could explaing a small slow leak. THe work-around is to open once and re-use the ref. Only clos it when you run into an error or are done.
Ben
06-26-2009 03:14 AM
Ok. Sounds that I have done what I can. But now I feel a little bit more safe.
Thank you for your support!
Regards
/Jesper
06-16-2023 04:14 PM
In 2023, with LabVIEW 2018 I am running in to same issue with SQL tool kit.
Slow memory leak with SQL.
06-16-2023 05:41 PM
This thread is about 14 years old and is marked as solved. You would likely be best served opening a new thread.
Also, if you could actually post the code that generates the memory leak, that's basically a requirement for getting help. Without that, it's nearly impossible to see the problem and suggest a solution.
06-19-2023 03:11 AM
@_TestMan_ wrote:
In 2023, with LabVIEW 2018 I am running in to same issue with SQL tool kit.
Slow memory leak with SQL.
did you implement the solution in this thread?