views:

99

answers:

1

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)?

+3  A: 

Well, the only tools I know that has this kind of features are the prevalence systems : prevayler and space4j. Although their interface will seems weird to you at first, they are however quite simple to use and offer a convenient feature set.

Riduidel
Thanks, looks like one of those should do the job.
Robert Wilson