While cleaning up the Forums from Spam I accidetally deleted a new topic about possible memory leaks in ZDBCIntfs. Please recreate the topic. It might be possible that you will have to reregister your user name, if you didn't post any topics in the past.
Best regards,
Jan
Topic about possible Memory leak in ZDbcIntfs
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Topic about possible Memory leak in ZDbcIntfs
You do not have the required permissions to view the files attached to this post.
Re: Topic about possible Memory leak in ZDbcIntfs
It won't leak, it's an interface:
private
FDriversCS: TCriticalSection; // thread-safety for FDrivers collection. Not the drivers themselves!
FLogCS: TCriticalSection; // thread-safety for logging listeners
FDrivers: IZCollection;
FLoggingListeners: IZCollection;
FGarbageCollector: IZCollection;
private
FDriversCS: TCriticalSection; // thread-safety for FDrivers collection. Not the drivers themselves!
FLogCS: TCriticalSection; // thread-safety for logging listeners
FDrivers: IZCollection;
FLoggingListeners: IZCollection;
FGarbageCollector: IZCollection;
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Re: Topic about possible Memory leak in ZDbcIntfs
I have this erros on Lazarus 2.2.0
You do not have the required permissions to view the files attached to this post.
Re: Topic about possible Memory leak in ZDbcIntfs
The log points to the unit initialization of ZDbcIntFs, which looks like this:
These variables are global, defined like:
Finalization correctly seems to free up these objects. Is it possible that your app exits ungracefully (or by using Halt) so uninitializations aren't executed?
Code: Select all
initialization
DriverManager := TZDriverManager.Create;
GlobalCriticalSection := TCriticalSection.Create;
finalization
DriverManager := nil;
FreeAndNil(GlobalCriticalSection);
Code: Select all
var
/// <summary>The common driver manager object.</summary>
DriverManager: IZDriverManager;
/// <summary>The global critical section.</summary>
GlobalCriticalSection: TCriticalSection;
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47