I am working on a program that analyzes data from a file and saves it in the HSQLDB database. When the parser encounters data, it creates objects that map to the database using JPA / Hibernate. My problem is that while analyzing the running application it uses more and more memory. I have successfully used cached tables so that after the parsing is complete everything will be released, but during the parsing it uses the path more than I'm comfortable with.
I tried to fix this by calling flushand clearmy the EntityManager, but it has not affected. I also tried to make sure that Entity with references to all other objects is stored in memory.
The biggest objects in memory seem to be hsqldb.Sessions. Maybe HSQlDb caches a lot of data for each transaction? Excessive seems to need 1 GB of RAM to only get a database that is 120 MB on disk, right?
Please advise that I could try further.
source
share