Can I reduce the space of my cache memory?

拈花ヽ惹草 提交于 2019-12-13 05:04:34

问题


I am a newbie on GridGain and I have a problem with the heap size on my cache.

I have a CSV file with 2.000.000 ~ 3.000.000 lines, the size of the file is 600~800 megabytes, but when I load this data into my cache on GridGain I need 5~7 gigabytes. Can I reduce the size of the data in the cache? Or do I need 5~7 gigabytes to save a file with 600 megabytes?


回答1:


Here are the things that can affect memory consumption:

  1. Number of backups configured. If you have, for example, 1 backup configured, then you double the amount of memory needed on the cluster.
  2. Indexes - if you are creating indexes for your data, indexes do require additional space.
  3. If objects are stored in both, serialized and deserialized form, then extra space is required.

I think a good test would be to load the same data into a ConcurrentHashMap and see how much memory would be required for that. I would say, that in a distributed transactional cache like GridGain there is space taken up by versioning, locking, etc.. so the amount of memory required by a distributed cache should be about 2x or 3x of the space required by a simple ConcurrentHashMap.



来源:https://stackoverflow.com/questions/24692393/can-i-reduce-the-space-of-my-cache-memory

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