Database memory issue

Hi all,

Currently we are using Xojo as an API for our front end client. We are seeing issues with our Postgres database memory, over time the memory usage from the connection related to the API will kill the PSQL box as it runs out of available memory. The time can be dependant on the amount of users that are accessing the website. In order to get the memory back we have to restart the API. As soon as this is restarted the memory is returned.

We have some other worker apps (Xojo Console Apps) that connect to the same DB and they are not increasing the memory like the API does. These worker apps check the database every second, the only differences between the two are the API is using Prepared Statements and the workers are not.

Has anyone experienced any issues with memory increase over time using Prepared Statements? If so are the any suggestions to clear this memory.

Xojo 2019 r3.1 is being used to build currently

Currently, Prepared Statements are not being released and build up over time. The only way to handle it is to disconnect/reconnect, clearing all prepared statements, or cache and re-use them to reduce the build-up.

We solved the problem accidentally. Our middleware creates a new, temporary connection to the db on each new action, but this might not be practical in all situations.

<https://xojo.com/issue/41633>

Thank you for the swift reply on this :slight_smile:

[quote=475124:@Kem Tekinay]Currently, Prepared Statements are not being released and build up over time. The only way to handle it is to disconnect/reconnect, clearing all prepared statements, or cache and re-use them to reduce the build-up.

We solved the problem accidentally. Our middleware creates a new, temporary connection to the db on each new action, but this might not be practical in all situations.

<https://xojo.com/issue/41633>[/quote]

An old problem copied over to API 2.0 .

No copy
API 2.0 is a new Xojo API on top of the same old C++ framework code and very little new framework code from what I can tell
So old problems persist if they are in the C++ layer

Right, I’ve chosen the wrong word, and understand what you explain to us Norman.
But I keep thinking that It’s a pity that so long-known problems are not yet solved with this movement.
I am still on 1.0, waiting for the real need to jump over to the new API. W.E. 2.0 I guess / hope.