Hi,

 I am using Spring boot In-Memory H2DB. I am storing latest 100k records in 
the database, so keep on deleting old records and inserting new records. 
Application runs fine for 4-5 hours, after that it throws OOM Exception. 
The memory consumption keeps on increasing even after deleting old records. 
I took the thread dump and analysed in MAT, it shows one memory leak.

One instance of org.h2.mvstore.tx.TransactionStore$TxMapBuilder$TMVMap 
loaded by org.springframework.boot.loader.LaunchedURLClassLoader @ 
0x6c0737918 occupies 2,08,58,61,856 (77.95%) bytes. The memory is 
accumulated in one instance of org.h2.mvstore.Page$PageReference[], loaded 
by org.springframework.boot.loader.LaunchedURLClassLoader @ 0x6c0737918, 
which occupies 2,08,58,61,384 (77.95%) bytes.

When I restart the application with same number of records in H2db, it 
takes only 30% of memory.

*H2db Version*: 2.1.212

*Spring boot*: 2.7.1

*Spring data JPA*:2.7.1

*spring.datasource.url*
=jdbc:h2:mem:db;DB_CLOSE_ON_EXIT=FALSE;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/ff956fd3-e598-4895-9060-b6c925351cbfn%40googlegroups.com.

Reply via email to