Sign in Join

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

Mailing lists / lazarus / 2021-12

SQLDBRestBridge memory consumption attn Michael

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Michael Van Canneyt
zeljko wrote 15 lines
Hi all, fpc-3.2.2, lazarus trunk...found that sqldbrestdispatcher does not free some unused resources, so sqldbrestserver memory alloc grows and after few thousand connections eats more than 1GB of memory. Just found in TSQLDBRestDispatcher.HandleResourceRequest that H: TSQLDBRestDBHandler is created for each request but freed when dispatcher is destroyed. So, dispatcher in this case can contain thousands of TSQLDBRestDBHandler unused components (could not find that dispatcher reuse any of this). I've added H.Free at last place in finally section and it seem that memory does not grow too much at all (still grows but slower, probably there's still unused resources around). Solution would be to reuse TSQLDBRestDBHandler's or free them. Pls look at https://forum.lazarus.freepascal.org/index.php/topic,51938.msg382021.html#msg382021

Forum is down, but I distinctly remember fixing this memleak.

It was not on my main development machine, but in a Windows VM. Probably I forgot to commit that at the time :/

I applied a fix (free the handler), and fixed some compiler hints/warnings as well.

I did a test, and I can't reproduce memleaks with the current demo application (the -m option exists for this very purpose), but that doesn't mean there are no memleaks left, there are many different execution paths :/

Michael.

Reply by email