Jump to content
  • Advertisement
Sign in to follow this  

Implementing an efficient memory cache (or choosing an existing library)

This topic is 569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I'm writing a procedural voxel->polygon engine and I need to frequently generate/save/load and destroy chunks.

I'd like to avoid regenerating, and especially loading (== touching the disk) chunks, which have been recently used, by employing a memory cache.

Ideally, I'd like to reserve a fixed-size memory block for the 'chunk cache', address cached chunks by their IDs and specify chunk eviction policy/expiration time.


How to best implement such a cache? (i.e. fast and efficient, no fragmentation.)

Could you give me any references to existing implementations?


I found these libraries, but they seem too 'heavy' for my toy voxel engine:

http://cachelot.io/ and memcached

Is there anything more lightweight?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!