Java中的内存映射集合 [英] Memory mapped collections in Java

查看:152
本文介绍了Java中的内存映射集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我填满了JVM堆空间。

I'm filling up the JVM Heap Space.

更改参数以给JVM更多的堆空间,或者在代码中更改某些代码,使用这么多的空间是两个最推荐的选项。

Changing parameters to give more heap space to the JVM, or changing something in my algorithm in the code not to use so much space are two of the most recommended options.

但是,如果这两个已经尝试和应用,我仍然失去内存异常, d喜欢看其他选项。

But, if those two have already been tried and applied, and I still get out of memory exceptions, I'd like to see what the other options are.

我发现了这个例子为一个巨大的矩阵使用内存映射文件和一个名为 HugeCollections 这是一个有趣的方式来解决我的问题。不幸的是,图书馆没有看到一个更新了一年多,它不是在任何Maven仓库 - 所以对我来说,这不是一个真正可靠的。

I found out about this example of "Using a memory mapped file for a huge matrix" and a library called HugeCollections which are an interesting way to solve my problem. Unluckily, the library hasn't seen an update for over a year, and it's not in any Maven repo - so for me it's not a really reliable one.

我的问题是,是否有任何其他库这样做,或者是一个很好的方式实现它(有集合对象(列表和集合)内存映射)?

My question is, is there any other library doing this, or a good way of achieving it (having collection objects (lists and sets) memory mapped)?

推荐答案

不幸的是,图书馆没有看到一个更新一年多,它不是在任何Maven仓库 - 所以对我来说这不是一个真正可靠的一个我同意,我写了。 ;)

Unluckily, the library hasn't seen an update for over a year, and it's not in any Maven repo - so for me it's not a really reliable one I agree and I wrote it. ;)

我建议您查看 https ://github.com/peter-lawrey/Java-Chronicle 这个更高的性能已经用了一点。它真的设计为List& Queue,但您可以将其用于具有其他数据结构的Map或Set。

I suggest you look at https://github.com/peter-lawrey/Java-Chronicle which is higher performance has been used a bit. It really design for List & Queue but you could use it for a Map or Set with additional data structures.

根据您的要求,您可以编写自己的库。例如对于时间序列数据我写了一个不同的库,这是不是开源不幸的是,但可以加载表的500+ GB相当干净。

Depending on your requirements, you could write your own library. e.g. for time series data I wrote a different library which is not open source unfortunately but can load tables of 500+ GB pretty cleanly.


在任何Maven仓库

it's not in any Maven repo

这不是一个,但会很高兴有人添加它。

Neither is this one but would be happy for someone to add it.

这篇关于Java中的内存映射集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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