java - 整数数组与单个整数?
解决方案
If you have "tens of millions" of small arrays, then you have tens of millions of the array object overhead.
A int[4]
would take a reference value (4 bytes), and an array (16 bytes overhead), so 10 million values would use 200 Mb extra space. If you run Java with lots of memory, so compressed OOPS cannot be used, the extra space use is higher.
To store a 128-bit value, I would recommend using two long
fields.
推荐阅读
- javascript - 断言不可解析的数字
- android - Ubuntu:生成apk android studio 3.3
- primefaces - 将图标(例如材料设计或 Prime 图标)添加到 ap:inputText
- html - 具有可滚动内容和固定导航栏的 div
- android - 如何解耦房间实体
- javascript - 我在向画布添加对象时遇到了很多麻烦,但它比这复杂得多
- windows - 为什么我在 Windows 的不同终端中激活 anaconda 环境时会得到不同的结果?
- python - Django:避免数据类型限制
- json - 如何使用 shell 脚本管道 json 卷曲以发送松弛消息
- angular - 如何在 home.page.scss 内的 angular + ionic 应用程序中设置背景图像?