A colleague mentioned that he heard about a lightweight collection which would automatically page out to disk when it's contents got too full - but he couldn't remember the name. I would imagine it looks something like this:
PagingCollection<Serializable> pagingCollection = new PagingArrayList<>();
pagingCollection.setMaxSizeInMemory(500);
for (int x = 0; x < 1000; x++) { pagingcollection.add("x="+x); }
Which would then push x=0 to x=500 to disk. The key would be being able to iterate over it without loading the whole thing into memory..
This is for a thick client with low amounts of memory.
Does anyone know of it (or something similar)?
Well, the only tools I know that has this kind of features are the prevalence systems : prevayler and space4j (the later seems to no more have a dedicated website, but to be still available ... on Sourceforge). Although their interface will seems weird to you at first, they are however quite simple to use and offer a convenient feature set.
MapDB (mapdb.org) is a library that supports disk based collections: Sets, Queues and Maps.
You can choose yourself when to persist it do disk or just persist on every update.
It also supports caching so all your items will be on disk but some cached in memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With