Linux commands: Difference between revisions
Jump to navigation
Jump to search
→System memory usage
| Line 384: | Line 384: | ||
=== System memory usage === | === System memory usage === | ||
Memory | ==== Obtaining Memory Usage through a WQL Query ==== | ||
on {{Win}}: | |||
* namespace: ROOT\CIMV2 | |||
* WQL query: {{kbd | key= SELECT FreePhysicalMemory, TotalVisibleMemorySize FROM Win32_OperatingSystem}}<ref>[http://www.perlmonks.org/?node_id=882932 Collect Memory Data from WMI (Win32)]</ref> | |||
* output example: 21683460 ([https://msdn.microsoft.com/zh-tw/library/system.uint64(v=vs.110).aspx UInt64, 64 bit Unsigned Integer]) unit: KB | |||
* memory usage = (FreePhysicalMemory * 100) / TotalVisibleMemorySize; unit: % | |||
==== Obtaining Memory Usage through free command ==== | |||
on freebsd & {{Linux}} | |||
* command: {{kbd | key = free}} | |||
* output example: | |||
<pre> | <pre> | ||
total used free shared buffers cached | total used free shared buffers cached | ||
| Line 400: | Line 401: | ||
Swap: 4194300 1219364 2974936 | Swap: 4194300 1219364 2974936 | ||
</pre> | </pre> | ||
* memory usage = 7922496 / 8060416; unit: % | |||
==== Obtaining Memory Usage through top command ==== | |||
{{Mac}} (known as [https://zh.wikipedia.org/zh-tw/Darwin_(%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F) Darwin]): | |||
* command: {{kbd | key = top -l 1 | grep PhysMem:}} | |||
* output example: PhysMem: 8017M used (1486M wired), 172M unused. | |||
* memory usage: 172 / (8017+172); unit: % | |||
=== System disk space usage === | === System disk space usage === | ||