Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-10

MS SQLConn - Possible memory leak in driver (dblib or libiconv2)

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcos Douglas

Hi,

My FPC is 2.6.5 on Windows + SQLServer 2008.

I have a big loop. This loop calls a INSERT script (using SQLdb) to insert records at a table.
Everything works. I do not have mem-leak (heaptrc dialog is 0 unfreed) in my code. But the Windows "Commit charge" grows up exponential and I got an error "virtual memory...".

So, I think this memory leak could be in dblib.dll or libiconv2.

Another possibility of this bug is the SQLdb itself. If I close the program, all memory going to free. But until it is open the memory grows up, even after ApplyUpdates and Commit.

Somebody can help me?

More info:
Lazarus 1.3 r46340M FPC 2.6.5 i386-win32-win32/win64 and SQLServer 2008.

Best regards,
Marcos Douglas

Reinier Olislagers
to Marcos Douglas
Marcos Douglas wrote 5 lines
I have a big loop. This loop calls a INSERT script (using SQLdb) to insert records at a table. Everything works. I do not have mem-leak (heaptrc dialog is 0 unfreed) in my code. But the Windows "Commit charge" grows up exponential and I got an error "virtual memory...".

Does this loop happen to read through a dataset itself? If so, see the IIRC working with sqlquery wiki page, look for out of memory error; solution is there.

LacaK
to Marcos Douglas: My FPC is 2.6.5 on Windows + SQLServer 2008. I have a big loop. This loop calls a INSERT…

Hi Marcos,
First useful thing would be isolate source of memory leak. If it is on FreePascal side, then we must search there, if it is on FreeTDS side, then we must report bug to FreeTDS project. You can use version of dblib.dll, which does not use libiconv2, so we can isolate it.
Do you not use any other 3rd party libraries or other components in your project, which can cause mem leaks ?
-Laco.

Show quoted text 29 lines
Hi, My FPC is 2.6.5 on Windows + SQLServer 2008. I have a big loop. This loop calls a INSERT script (using SQLdb) to insert records at a table. Everything works. I do not have mem-leak (heaptrc dialog is 0 unfreed) in my code. But the Windows "Commit charge" grows up exponential and I got an error "virtual memory...". So, I think this memory leak could be in dblib.dll or libiconv2. Another possibility of this bug is the SQLdb itself. If I close the program, all memory going to free. But until it is open the memory grows up, even after ApplyUpdates and Commit. Somebody can help me? More info: Lazarus 1.3 r46340M FPC 2.6.5 i386-win32-win32/win64 and SQLServer 2008. Best regards, Marcos Douglas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Marcos Douglas
to LacaK

Hi Laco,

LacaK wrote 6 lines
Hi Marcos, First useful thing would be isolate source of memory leak. If it is on FreePascal side, then we must search there, if it is on FreeTDS side, then we must report bug to FreeTDS project. You can use version of dblib.dll, which does not use libiconv2, so we can isolate it.

I use libconv2.

Do you not use any other 3rd party libraries or other components in your project, which can cause mem leaks ?

Yes, my own project, Greyhound. But this is not the problem...

I use a module, coded by another programmer, that was changed internally. My program uses the same methods but internally was changed. Before it used a simple script and now a "Table" (TSQLQuery and ApplyUpdates/Commit). So, if you use ApplyUpdates/Commit everything works but the registers will grow up, in memory... of course! But I didn't have time, I had to release a new version and I didn't SEE this, when I opened the (3rd) code, at the first time.

So does not have a memory leak. Was my fault. Sorry the noise. :(((

Thanks for your return.

Best regards,
Marcos Douglas