Java集合,当它充满时页面到磁盘? [英] Java Collection which pages to disk when it gets full?

查看:116
本文介绍了Java集合,当它充满时页面到磁盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一位同事提到,他听说一个轻量级的集合,当内容太满时,它会自动翻页到磁盘 - 但他不记得名字了。我想象它看起来像这样:

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); }

然后将x = 0到x = 500推送到磁盘。

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

推荐答案

只有工具,我知道有这种功能是流行的系统: prevayler space4j 。虽然他们的界面起初看起来很奇怪,但是使用起来非常简单,并且提供了方便的功能集。

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.

这篇关于Java集合,当它充满时页面到磁盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆