How to compress memory space of h2 database ( in-memory mode)?

我的梦境 提交于 2019-12-13 18:34:01

问题


h2 seems to take up too much memory space, How to compress it


回答1:


Do you use the in-memory mode (database URL jdbc:h2:mem:test or similar)? H2 uses a pluggable file system / file system abstraction, and as part of that there is are two in-memory file system implementations, one of them compresses the data. To use it, use one of the following database URLs:

  • jdbc:h2:memFS:test (regular in-memory file system; a bit slower than jdbc:h2:mem:test but uses a bit less memory)
  • jdbc:h2:memLZF:test (compressed in-memory file systems; slower than the above but uses less memory, maybe half or a third)

If you use the persisted mode: H2 uses quite little memory by default for the cache (16 MB), but you can reduce the cache size if needed (see the docs).



来源:https://stackoverflow.com/questions/12069224/how-to-compress-memory-space-of-h2-database-in-memory-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!