前几天晚上,oom-killer 被召唤在一台运行良好的 linux 机器上,因为整体 RAM 的使用在某些时候失控了。/var/log/messages 中的输出让我有点惊讶,因为它显示了 rmiregistry 进程使用了将近 1G 的内存。我们的系统非常简单,只将一个对象绑定到 rmiregistry,它只是静态方法的集合。因此该对象本身几乎不使用内存。在正常系统上,该进程的大小更像是 30M,对我来说仍然很高。除了加载由绑定对象序列化的类,也许是绑定对象的某种表示,rmiregistry 进程中实际存储了什么?我正在使用 OpenJDK 1.6.0_33。
问问题
389 次
1 回答
0
Other than loading the classes serialized by the bound object, and maybe some representation of the bound object somehow, what is actually stored in the rmiregistry process?
Nothing. It just contains a hash table mapping Strings to Remotes, which implies loading the class of the Remote (usually a stub) and all the classes it depends on, recursively until closure. The rest of it is all JVM overhead.
于 2015-01-12T04:20:35.200 回答