linux内存经常被用掉90%多,只有一个java程序

发布于 2022-10-03 03:01:54 字数 70 浏览 19 评论 0

4个AMD大锤,4G内存
只有一个java程序在跑,top显示jvm使用了400M,但是整个系统的内存已经用了3G多,请高手指点

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那一片橙海, 2022-10-10 03:01:54

原帖由 "shailq" 发表:
4个AMD大锤,4G内存
只有一个java程序在跑,top显示jvm使用了400M,但是整个系统的内存已经用了3G多,请高手指点

巨型 JVM ? 玩笑, 是否 有很多 线程? 有 1500左右?

神魇的王 2022-10-10 03:01:54

同时跑的最多40-50个线程

谜兔 2022-10-10 03:01:54

Q: Why is Linux using up all my memory?

A: You may notice as you use Linux that a lot of RAM is in use, even when you're not running very many programs. You may be thinking that there are problems with memory leaks, or that your available RAM is being used inefficiently.

One quick and easy way to find out how much RAM you really have available, though, is to use the command-line utility 'free.' If you are running Gnome, KDE, or another graphical interface, open up a terminal window and type 'free' (without the quotes). Its output looks something like this (edited for brevity):

                    total          used           free
Mem:                515364         497208         18156
-/+ buffers/cache:  352512         162852
Swap:               497972         176            497796

The significant row in this output is the one labelled -/+ buffers/cache. Notice that out of 512MB of RAM, only 352MB is in use---even though it appears from the first line that 497MB is in use.

Unless you experience significant slowdowns and hard drive activity, it's unlikely that you are experiencing any problems with memory usage. Besides, if you paid good money for all the RAM you have, you might as well be using it---it's no good to you sitting around doing nothing.

Another tool that you may find useful, if you find that a lot of your RAM is being used, is 'top.' Again, from a terminal window or console, type 'top' (without the quotes). You will see a dynamically-updated list of the currently-running programs on your computer. The name of each program is shown on the far right, along with information about how much CPU and memory each program is using. If you press 'M' while 'top' is running, the programs will be shown in decreasing order of memory usage. This may help you to pinpoint what programs are using the most memory. In some cases, those programs can be shut down (if you do not need them running), or configured to use less memory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文