https://kotlinlang.org logo
#exposed
Title
# exposed
e

edwinRNDR

09/14/2021, 10:17 AM
Hi, I suspect that what I am doing with Exposed (0.31) is leaking memory and/or resources. Are there ways to disable all of Exposed's caching? What are tools to detect improper use of the Exposed DAO?
b

Bogdan

09/14/2021, 2:24 PM
why do you think there is a leak? Can't see the code with DAO
Copy code
val user: Column<User> = ?????????????????????????
most likely need reference
👀 1
e

edwinRNDR

09/14/2021, 2:57 PM
I think there is a leak because over time anything I do against the database is slow and my program uses a lot of memory. I am not saying this is an issue in Exposed per se. I am just looking for a way to disable caching to quickly eliminate it from the list of possible causes
b

Bogdan

09/14/2021, 4:09 PM
what kind of caching? In your examples, there is no Entity exposed (only they are cached), therefore there is nothing to disable
e

edwinRNDR

09/14/2021, 4:09 PM
I haven't posted any examples
b

Bogdan

09/14/2021, 4:10 PM
most likely you are doing a lot of transactions
e

edwinRNDR

09/14/2021, 4:10 PM
yes, and?
b

Bogdan

09/14/2021, 4:11 PM
I haven't posted any example
how difficult. are you using Entity?
yes, and?
read what a transaction is, they can block each other
My English not so good
e

edwinRNDR

09/14/2021, 4:18 PM
if transactions are in some way postponed and eventually pile up then I'd like to hear how to disable that.
b

Bogdan

09/14/2021, 5:11 PM
transactions impose restrictions on, for example, table entries. It is not possible in an RDBMS to write to one table from different threads (transactions) https://en.wikipedia.org/wiki/Database_transaction https://www.tutorialspoint.com/dbms/dbms_transaction.htm
the transaction must be atomic
https://github.com/JetBrains/Exposed/wiki/DAO This is where the cache is used (for Entity). If you use it, then you should look at an example where problems appear.
t

tapac

09/15/2021, 10:40 AM
@edwinRNDR, there can be diferrent type of leaks: connection leak, prepared statement leak, resultset leak, etc, what kind of do you have? Entity Cache is bound to transaction and memory should be free after the end of transaction block.
The more details needed to help you, also try to update to the latest 0.34.2 version as there were few performance improvements
7 Views