JVM内存和CPU使用的实际限制? [英] Practical limitations of JVM memory and CPU usage?

查看:2134
本文介绍了JVM内存和CPU使用的实际限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说金钱不是限制因素,我想编写一个在一台强大的机器上运行的Java程序。

Let's say money was not a limiting factor, and I wanted to write a Java program that ran on a single powerful machine.

目标是让Java程序尽可能快地运行而无需交换或转到磁盘

The goal would be to make the Java program run as fast as possible without having to swap or go to disk for anything.

假设这台电脑有:


  • 1 TB的RAM(64 16GB DIMM)

  • 64个处理器内核(8个8核处理器)

  • 运行64位Ubuntu

在JVM中运行的java程序的单个实例是否可以利用这么多RAM和处理器?

Could a single instance of a java program running in a JVM take advantage of this much RAM and processors?

是是否存在可能限制使用和效率的实际考虑因素?

Are there any practical considerations that might limit the usage and efficiency?


  • 操作系统进程(内存和线程)限制?

  • JVM内存/堆限制?

  • JVM线程限制?

谢谢,
Galen

Thanks, Galen

推荐答案

单个实例可以尝试访问所有内存,但是NUMA区域意味着诸如GC执行错误访问另一个区域的内存。这变得越来越快,JVM有一些NUMA支持,但如果你想要可扩展性,它需要改进。即使如此,您也可以获得256 MB的堆并使用700个本机/直接内存而不会出现此问题。 ;)

A single instance can try to acces all the memory, however NUMA regions mean that things such as GC perform badly accessing memory in another region. This is getting faster and JVM has some NUMA support but it needs to improve if you want scalability. Even so you can get 256 MB of heap and use 700 of native/direct memory without this issue. ;)

如果你有大量内存,最大的限制是数组,集合和ByteBuffer(用于内存映射文件)都限制在20亿的大小。 (2 ^ 31-1)

The biggest limitation if you have loads of memory is that arrays, collections and ByteBuffer (for memory mapped files) are all limited to a size of 2 billion. (2^31-1)

您可以使用自定义集合解决这些问题,但Java应该支持IMHO。

You can work around these problems with custom collections, but its really something Java should support IMHO.

顺便说一句:您可以购买带有1 TB内存的Dell R910和带有Ubuntu的24核/ 48线程,价格为40,000英镑。

BTW: You can buy a Dell R910 with 1 TB of memory and 24 cores/48 threads with Ubuntu for £40K.

BTW:我只有拥有最大40 GB的JVM经验。

BTW: I only have experience of JVMs up to 40 GB in size.

这篇关于JVM内存和CPU使用的实际限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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