问题描述
我一直在网上搜索,想知道一个 java 进程可以在 linux (red-hat) 机器上占用多少内存.(我不是在谈论堆;而是 Java Process 占用的全部内存量)
I have been scouring the internet to find out how much memory a java process can take on a linux (red-hat) machine. ( I am not talking about heap; rather, the entire amount of memory taken up by the java Process)
我无权在该机器上执行任何操作.所以我不能简单地执行一个消耗内存的程序,直到出现内存不足的情况.
I don't have permission to execute anything on that machine. So I can't simply execute a program that consumes memory until Out-Of-Memory condition.
但是,我确实有权限检查配置文件等(例如:我尝试执行 cat/proc/meminfo,但我无法理解它;它的结果似乎都不代表我的参数想了解一下).
However, I do have permission to check config files, etc. ( for example: I tried to execute cat /proc/meminfo, but I can't understand it; it appears that none of its results stand for the parameter I want to know about).
我在一台单独的 red hat 机器上尝试了一个 java 程序——我确实有权在这台机器上执行程序——并且我能够看到 java 程序增长到大约 3GB.
I have tried out a java program on a separate red hat machine - on which I do have permission to execute programs - and I was able to see java program grow up to around 3GB.
有什么方法可以找出一个进程可以获得多少内存?
Is there some way I can find out how much memory a process can get ?
推荐答案
ulimit 是您的朋友.Java 进程与其他进程没有什么不同.但是如果你连 ulimit -a 都不能运行,就很难回答你的问题.
ulimit is your friend. Java processes are no different than any others. But if you can't even run ulimit -a, it's hard to answer your question.
这篇关于Linux中如何确定进程内存限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!