IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Memory Leak?
Jetty
post 25. Nov 2009, 21:29
Post #1


new Member
*

Group: Members
Posts: 4
Joined: 30.01.2009
Member No.: 89
LV Version: 8.6
Zertifizierung: keine



Greetings:

Trying to isolate a memory leak in my Labview application I've come across what I think may be the culprit - opening and closing an Access database using ADO-Toolkit (1.7.2a). To test this I built a small routine that simply opens an Acess database using ADOTool_Open_Access_Database.vi then closes it using ADOToolkit_Close_Connection.vi. When this is put in continuous while loop, memory continues to get consumed.

Any insight would greatly be appreciated.

Thx,

Jetty

BTW - Using Labview 8.6
Go to the top of the page
 
+Quote Post
CB
post 28. Nov 2009, 08:30
Post #2


proven Member
****

Group: Administrators
Posts: 315
Joined: 16.10.2006
From: Düsseldorf
Member No.: 2
LV Version: current
Zertifizierung: CLA
LV User seit: 2001



QUOTE (Jetty @ 25. Nov 2009, 22:29) *
Trying to isolate a memory leak in my Labview application I've come across what I think may be the culprit - opening and closing an Access database using ADO-Toolkit (1.7.2a). To test this I built a small routine that simply opens an Acess database using ADOTool_Open_Access_Database.vi then closes it using ADOToolkit_Close_Connection.vi. When this is put in continuous while loop, memory continues to get consumed.


i'll check that ...


--------------------
künstliche Intelligenz ist besser als natürliche Dummheit!
rotabench:rotierende Prüfstände nach dem Baukasten-Prinzip
Go to the top of the page
 
+Quote Post
CB
post 28. Nov 2009, 08:53
Post #3


proven Member
****

Group: Administrators
Posts: 315
Joined: 16.10.2006
From: Düsseldorf
Member No.: 2
LV Version: current
Zertifizierung: CLA
LV User seit: 2001



I just checked that with a simple test-VI and according to my results there is NO memory leak in the ADO toolkit!

My advise is: make sure that there is "no error" in the error cluster before you call the "Ado-Tool Close Connection.vi" because it's programmed in the standard VI behaviour: there is an case-structure around the whole code, which catches an incoming error:

Attached Image


if there is an error in the incoming error cluster none of the code will be executed => you have an open reference, or lots of open references which would of course cause a memory leak.

Here is the VI I used to test the ADO Tool

Attached File  ADO_Tool_MemLeak_Tester.vi ( 11.89K ) Number of downloads: 588


But Thank's anyway, that's a good hint -- i'll ad an "Close All Databases" Function to the ADO-Toolkit which forces the Close of all open References. Luckily I store all references in an LV2-Style-Global ...

Cheers,
CB


--------------------
künstliche Intelligenz ist besser als natürliche Dummheit!
rotabench:rotierende Prüfstände nach dem Baukasten-Prinzip
Go to the top of the page
 
+Quote Post
Jetty
post 20. Dec 2009, 04:15
Post #4


new Member
*

Group: Members
Posts: 4
Joined: 30.01.2009
Member No.: 89
LV Version: 8.6
Zertifizierung: keine



Greetings CB,

Sorry for the delay in responding but I've been tied up with another project. My question is, how are you testing for memory leaks? When I ran the vi you attached I am seeing a gradual increase in Virtual Memory. Even when eliminating everything (tables and select vi's) except the Open DB and Close DB I still see a memory leak.

I'm testing for memory usage using Microsoft Process Explorer 11.33. In a quick test, I ran the vi you created for 10min and virtual memory went from 63.0MB to 75.7MB (~1.27MB consumed/min). Over this amount of time your vi looped aprox 6400 iterations.

Graph is shown below

Attached Image


I've done similar tests using National's Database Connectivity Toolkit and Virtual memory didn't change at all. Any idea what's up?

Thanks again for you assistance,

Jetty
Go to the top of the page
 
+Quote Post
CB
post 23. Dec 2009, 08:59
Post #5


proven Member
****

Group: Administrators
Posts: 315
Joined: 16.10.2006
From: Düsseldorf
Member No.: 2
LV Version: current
Zertifizierung: CLA
LV User seit: 2001



Jetty, you are right!

there is was a memory leak!

please download the updated ADO-Tool VIs to get this fixed!

The test VI still consumes "some" Memory ~ 2 MB per 10000 open/close iterations. I'm not sure where this comes from, but my guess is this has something to do with the LV memory manager. The original Memory leak was caused by a missing "close Reference" primitive in the "close"-Case of the ADO-Tool API - which in fact does not cause any severe problems, unless you open and close a DB connection in your program very often ...

thank you for your input and meery X-mas!
CB



--------------------
künstliche Intelligenz ist besser als natürliche Dummheit!
rotabench:rotierende Prüfstände nach dem Baukasten-Prinzip
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 18.04.2024 - 10:55