Search code examples
javasqliteheap-memoryin-memory-databasejvisualvm

Uses SQLite in-memory database Java heap space?


I have developed an Eclipe RCP tool, which uses SQLite in order to store a big amount of tuples. Now, I wanted to see the difference in using RAM, while using an in-memory SQLite database in contrary to a file-based database. Therefore, I used JVisualVM and tracked the used Java heap space, by using the Trace tool. Under the same conditions, I ran my tool one time with the in-memory version and one time with the file-based version.

In order to simulate a benchmark, the tables all in all contained more than 30 millions of tuples with each on average 15 elements.

My expectations were, that the in-memory version uses a lot more Java heap space, than the file-based version. But the traces both look almost the same with no noticeable difference. Both Java heap spaces had the same maximum given and they never reached this maximum.

Therefore, my question is, does SQLite use the Java heap space for the in-memory database or is it in another part of the memory, which cannot be tracket by JVisualVM?

Unfortunately, I could not find anything about that on the internet. Just that it is in-memory, but not where in memory.

Thank you!!


Solution

  • SQLite is a native library and does not use Java heap space; it uses the native heap.