I use H2 DB in memory mode to process some data. My Java application should support the JVM while dropping and re-creating or trimming or deleting all objects in the H2 DB in each run. Therefore, I need to use the option "DB_CLOSE_DELAY = -1" in the database URL.
To clear memory after iteration, I tried using "DROP ALL OBJECTS", "DROP ALL OBJECTS DELETE FILES" and "Truncate each table one at a time." All of them achieved what I wanted, did not delete the memory that is currently occupied by him. The size of my database varies from 300 MB to 2 GB. Therefore, after one iteration, my RAM takes about 1 GB and does not find any solution as to the reason for this or the permission.
Just like this. Clear the database in memory after each test. But without dbUnit, you also need to clear RAM.
Is it possible to do this without stopping the JVM.
Thank.
source
share