Memory usage - Virtual Bytes

Mikhail Firsov 1,876 Reputation points
2022-04-11T10:58:50.247+00:00

Hello!

Today got puzzled a bit by running this command on one of my HV servers:

Get-Process |
Format-Table Name,
@{n='VM(MB)';e={$_.VM / 1MB -as [int]}} -autosize

191873-2.png

Am getting it right that on the system with 20GB of virtual memory this command returns the VM size =~2TB???

Regards,
Michael

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,122 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,363 questions
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,351 Reputation points
    2022-04-14T08:48:51.01+00:00

    Hi there,

    This is right in accordance with the Process Virtual Memory Concept.

    Processes are not aware of physical hardware. Each process is given its own, private, virtual address space which is a finite amount of virtual memory

    Each process has a finite amount of virtual address space that it cannot exceed. The amount of virtual memory per process depends on if it was compiled as 32-bit or 64-bit. x86 is the 32-bit implementation of Windows. x64 is the current 64-bit implementation of Windows.

    For example, 64-bit processes have 8 TB of virtual address space.


    --If the reply is helpful, please Upvote and Accept it as an answer–

    1 person found this answer helpful.
    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Rich Matheisen 44,776 Reputation points
    2022-04-11T14:41:03.513+00:00

    That looks right.

    From: system.diagnostics.process.virtualmemorysize64

    Gets the amount of the virtual memory, in bytes, allocated for the associated process

    As opposed to the deprecated VirtualMemorySize property: system.diagnostics.process.virtualmemorysize

    The amount of virtual memory, in bytes, that the associated process has requested

    You might want to read this, too: 2361.windows-performance-guide-out-of-process-virtual-memory.aspx

    0 comments No comments

  2. Mikhail Firsov 1,876 Reputation points
    2022-04-12T08:25:53.953+00:00

    Sorry, I didn't find the explanation in the articles you posted above:

    1) 2101302MB is > than the total size of my physical RAM + all page files

    2) 2101302MB is not = the maximum memory process size:
    192200-04.png

    Actually I prefer monitoring processes' working set and page file usage, not the VM counter - just wondering what's the purpose of monitoring the processes' VM if for many of them the value of this counter will always be 2101302MB ...

    Regards,
    Michael


  3. Mikhail Firsov 1,876 Reputation points
    2022-04-14T08:59:54.56+00:00

    Yes, I know it, but the problem is: if "Each process is given its own, private, virtual address space which is a finite amount of virtual memory" - and there's the VM counter in Windows that must reflect this "finite amount of virtual memory" given to each process I would expect that the values of this counter for various processes would be different (and would reflect the processes' demands for virtual memory). If this statement ("Each process is given its own") means almost all processes are assigned ~2TB of virtual memory I don't see what valuable information administrators can gain from the VM counter.

    0 comments No comments

  4. Mikhail Firsov 1,876 Reputation points
    2022-04-15T08:10:38.59+00:00

    Hi RichMatheisen-8856,

    Sorry - didn't noticed your comments, ...still can't get used to the two places for answers and don't understand why there's the Comment section has been added to the forum: should the post in the Comment section be the correct answer it can't be mark because it's a comment :(

    Regarding the

    1. "What values do you get from performance monitor?" - the same as I posted above (~2TB per many processes.

    2) " You "didn't find the explanation in the articles", but yet you accepted the answer @Limitless Technology gave you which was copied verbatim, without attribution, from one of the links I offered???" - I've concluded that if it's by design the thread must be closed, even if I don't understand it/can't find the explanation.

    Thank you all once again for your help!

    Regards,
    Michael

    0 comments No comments