简体   繁体   English

如何测量应用程序或进程的实际内存使用情况?

[英]How can I measure the actual memory usage of an application or process?

How do you measure the memory usage of an application or process in Linux?你如何测量 Linux 中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解 Linux 上的内存使用情况的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.取决于您如何看待它, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它真正做的是显示如果每个进程是唯一正在运行的进程,它将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,典型的 Linux 机器在任何给定时间都有几十个进程在运行,这意味着ps报告的 VSZ 和 RSS 数字几乎肯定是错误的

(Note: This question is covered here in great detail.) (注意:这里详细介绍了这个问题。)

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

Valgrind is amazing if you have the time to run it. 如果您有时间运行,Valgrind会很棒。 valgrind --tool=massif is The Right Solution. valgrind --tool=massif是正确的解决方案。

However, I'm starting to run larger examples, and using valgrind is no longer practical. 但是,我开始运行更大的示例,并且使用valgrind不再可行。 Is there a way to tell the maximum memory usage (modulo page size and shared pages) of a program? 有没有办法确定程序的最大内存使用量(模数页面大小和共享页面)?

On a real unix system, /usr/bin/time -v works. 在实际的UNIX系统上, /usr/bin/time -v可以工作。 On Linux, however, this does not work. 在Linux上,但是,这行不通的。

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

Given some of the answers (thanks thomasrutter), to get the actual swap and RAM for a single application, I came up with the following, say we want to know what 'firefox' is using鉴于一些答案(感谢 thomasrutter),为了获得单个应用程序的实际交换和 RAM,我想出了以下内容,假设我们想知道“firefox”正在使用什么

sudo smem | awk '/firefox/{swap += $5; pss += $7;} END {print "swap = "swap/1024" PSS = "pss/1024}'

Or for libvirt;或者对于 libvirt;

sudo smem | awk '/libvirt/{swap += $5; pss += $7;} END {print "swap = "swap/1024" PSS = "pss/1024}'

This will give you the total in MB like so;这会给你以 MB 为单位的总数;

swap = 0 PSS = 2096.92

swap = 224.75 PSS = 421.455

Tested on ubuntu 16.04 through 20.04.在 ubuntu 16.04 到 20.04 上测试。

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

使用ubuntu中提供的内置“ 系统监视器 ” GUI工具

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

This question is covered here in great detail.这个问题在这里详细介绍。

How do you measure the memory usage of an application or process in Linux?您如何衡量Linux中应用程序或进程的内存使用情况?

From the blog article of Understanding memory usage on Linux , ps is not an accurate tool to use for this intent.了解Linux上的内存使用的博客文章中, ps不是用于此目的的准确工具。

Why ps is "wrong"为什么ps是“错误的”

Depending on how you look at it, ps is not reporting the real memory usage of processes.根据您的看法, ps不会报告进程的实际内存使用情况。 What it is really doing is showing how much real memory each process would take up if it were the only process running .它的真正作用是显示如果每个进程是唯一运行的进程每个进程将占用多少实际内存。 Of course, a typical Linux machine has several dozen processes running at any given time, which means that the VSZ and RSS numbers reported by ps are almost definitely wrong .当然,一台典型的Linux机器在任何给定时间都运行着数十个进程,这意味着ps报告的VSZ和RSS编号几乎肯定是错误的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM