Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Ask Me About Webinar: Data Center Assets - Modeling, Cooling, and CFD Simulation
Join our 30-minute expert session on July 10, 2025 (9:00 AM & 5:00 PM CET), to explore Digital Twins, cooling simulations, and IT infrastructure modeling. Learn how to boost resiliency and plan power capacity effectively. Register now to secure your spot!

Geo SCADA 2023 March Update ODBC Memory leak?

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • Geo SCADA 2023 March Update ODBC Memory leak?
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
310
AndrewScott
Admiral AndrewScott
101
BevanWeiss
Spock BevanWeiss
94
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
38
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to EcoStruxure Geo SCADA Expert Forum
Solved
RobbieF
Crewman RobbieF
Crewman

Posted: ‎2025-06-25 08:03 PM

0 Likes
4
300
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-06-25 08:03 PM

Geo SCADA 2023 March Update ODBC Memory leak?

Hi everyone,

 

Many years ago, I wrote a client application in .NET 4.8 (C#) that uses GeoSCADAs ODBC driver to extract Historian data.

 

The customer has recently upgraded to GeoSCADA 2023 (6.86.8863.1) from ClearSCADA 2017R2 and I am noticing after the upgrade memory usage of both GeoSCADA and client application ballooning which is causing server issues. The same issue occurs with GeoSCADA 2022.

 

I have attached a very simple sample project (TestGSODBC.zip) to demonstrate the issue.  Note if running the project you will need to set the password and change the historic id and time stamps to something in appropriate in program.cs.
Also attached is the projects program.cs file renamed to program.txt to allow it to be attached.
When running you will see both the app and Geoscada's memory usage increase in task manager.

 

Is there something that I am doing wrong or is GeoSCADA misconfigured or is there a problem with the ODBC driver?  I think just opening and closing the connection also has this issue.

 

Any help would be greatly appreciated.

Robbie

Attachments
TestGSODBC.zip
Labels
  • Labels:
  • SCADA
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

Contact Support
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
RobbieF
Crewman RobbieF
Crewman

Posted: ‎2025-06-29 09:46 PM . Last Modified: ‎2025-06-29 11:25 PM

0 Likes
1
209
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-06-29 09:46 PM . Last Modified: ‎2025-06-29 11:25 PM

I think I have managed to sort the memory leak. I'm currently testing the fix in UAT.

Changes made:

1. I have switched to using a system data source with DSN= in the connection string, and enabled connection pooling via the ODBC64 UI.


2. I have Bevan to thank; He mentioned he uses DataAdapters but I believe the DataAdapter uses a data reader under the hood to Fill.  This sent alarm bells ringing that maybe the way I'm setting up the reader and disposing it is incorrect! 

Now I wrap the connection like before in a using statement and do not dispose the odbc command and reader instances.  Instead, I call close on the reader within the connection's using statement.

Fingers crossed!!!




See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Contact Support
Replies 4
RobbieF
Crewman RobbieF
Crewman

Posted: ‎2025-06-26 12:31 AM

0 Likes
0
279
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-06-26 12:31 AM

Just wanted to add to the above.  

At the moment I open and close the connection as required (its multithreaded) but if I use one static connection that I open once and use it through out memory appears to behave itself.  But is keeping one static connection open best practice for a long running application?

Reply

Link copied. Please paste this link to share this article on your social media post.

Contact Support
BevanWeiss
Spock BevanWeiss
Spock

Posted: ‎2025-06-26 09:33 PM

0 Likes
0
269
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-06-26 09:33 PM

I've got some services that are floating around that also use the ODBC driver to retrieve data from GeoSCADA Expert 2022+ Databases.  I haven't yet had any reports of them causing any issues (at either Server / Client side).  But then I don't use the DataReader either, I'm more a DataAdapter fan.

 

If you can narrow it down to a particular release of GeoSCADA Expert then you could more easily raise a support ticket with Schneider to further investigate.  I'm surprised that it would impact on the Server side as well as the Client, I'd expect given how much use the database interface into GeoSCADA Expert gets (with Crystal Reports, plus all the internal usage) that it would have been pretty well shaken out, and would get noticed if it was leaking.

The specific Windows Odbc Client driver would surprise me if such a resource leak slipped under the radar.

 

There wasn't any other changes made between the GeoSCADA versions?  Like going from v4.5 to v4.8 of the .NET Framework?

It's possible there were changes around Odbc connection pooling etc that might have resulted in connections (even closed ones) still lingering around in the background for a while.  That might add some small overhead to the server also (it would need to store data for each connection, even if it's just lingering).

You could possibly use Wireshark on your client PC (if remote) to see if it's indeed firing up separate ephemeral TCP sockets for each OdbcConnection, and then if they're still staying around for a while (the TCP connection isn't reset).


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

Contact Support
RobbieF
Crewman RobbieF
Crewman

Posted: ‎2025-06-29 09:46 PM . Last Modified: ‎2025-06-29 11:25 PM

0 Likes
1
210
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-06-29 09:46 PM . Last Modified: ‎2025-06-29 11:25 PM

I think I have managed to sort the memory leak. I'm currently testing the fix in UAT.

Changes made:

1. I have switched to using a system data source with DSN= in the connection string, and enabled connection pooling via the ODBC64 UI.


2. I have Bevan to thank; He mentioned he uses DataAdapters but I believe the DataAdapter uses a data reader under the hood to Fill.  This sent alarm bells ringing that maybe the way I'm setting up the reader and disposing it is incorrect! 

Now I wrap the connection like before in a using statement and do not dispose the odbc command and reader instances.  Instead, I call close on the reader within the connection's using statement.

Fingers crossed!!!




Reply

Link copied. Please paste this link to share this article on your social media post.

Contact Support
BevanWeiss
Spock BevanWeiss
Spock

Posted: ‎2025-06-30 10:01 PM

In response to RobbieF
1 Like
0
173
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-06-30 10:01 PM

It looks like you're spot on with DataAdapter using a DataReader behind the scenes

 

https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/populating-a-dataset-from-a-dataadapt...

The Fill method uses the DataReader object implicitly to return the column names and types that are used to create the tables in the DataSet, and the data to populate the rows of the tables in the DataSet.


And yep, I'd say that missing .Close() is likely going to make all the difference... Microsoft seem pretty keen on emphasing to do that..

https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/retrieving-data-using-a-datareader

Always call the Close method when you have finished using the DataReader object.

If your Command contains output parameters or return values, those values are not available until the DataReader is closed.

While a DataReader is open, the Connection is in use exclusively by that DataReader. You cannot execute any commands for the Connection, including creating another DataReader, until the original DataReader is closed.


A little disappointing that immediately after they make this statement they then show a couple of examples where they also have not explicitely called .Close() on the DbReader instances though.

 

I personally would have kept the using() statements for the command and reader instances, since they do implement IDisposable (hence have some unmanaged resources that they want to clean up).

 

I would have had something like... 




using (var Connection = new Connection)

{

  using (var Command = new Command)

  {

    using (var DbReader = new DbReader)

    {

 

      DbReader.Close();

    }

  }

Connection.Close();  // the disposal does do this... but we can do it too..

}



Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

Contact Support
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of