%EC%97%90%20%ED%95%B4%EB%8B%B9%ED%95%98%EB%8A%94%20nix%20%60free%60%20%EB%98%90%EB%8A%94%20DOS%20%60mem%60.png)
~에*아니야시스템 free
에서 시스템의 사용 가능한 메모리와 사용된 메모리의 총량을 표시합니다. 제가 조사한 바에 따르면 DOS mem
명령은 비슷하지만 64비트 버전의 Windows 7에서는 사용할 수 없습니다. 해당 mem
명령에 대한 기본 제공 대체 명령이 있습니까?
답변1
이들 모두는 킬로바이트를 반환합니다.
wmic
방법
wmic os get TotalVisibleMemorySize,FreePhysicalMemory
TotalVisibleMemorySize가 올바른지 잘 모르겠지만 그렇습니다.나타나다내 시스템에 실제 메모리를 표시합니다.
VB스크립트 방식
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394587%28v=vs.85%29.aspx
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colSettings
Wscript.Echo "Available Physical Memory: " & _
objOperatingSystem.FreePhysicalMemory
Next
파워셸 방식
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394587%28v=vs.85%29.aspx
# Get-FreeMemory.ps1 # Sample using PowerShell # 1st sample from http://msdn.microsoft.com/en-us/library/aa394587 # Thomas Lee $mem = Get-WmiObject -Class Win32_OperatingSystem # Display memory "System : {0}" -f $mem.csname "Free Memory: {0}" -f $mem.FreePhysicalMemory
이 스크립트는 다음 출력을 생성합니다.
PS C:\foo> .\get-freememory.ps1 System : COOKHAM8 Free Memory: 2776988
PowerShell 압축(cmd에서 호출)
powershell.exe -c (Get-WmiObject -Class Win32_OperatingSystem).FreePhysicalMemory