Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone,

I still have one more problem getting total/available virtual memory, maybe I'm doing something wrong and just wanted to know your professional comments :)

Select Case My.Computer.Info.TotalVirtualMemory
   Case Is >= 1073741824
       GetRAMInfo += FormatNumber(My.Computer.Info.TotalVirtualMemory / 1073741824, 0) + " GB" + vbNewLine
   Case 1048576 To 1073741823
       GetRAMInfo += FormatNumber(My.Computer.Info.TotalVirtualMemory / 1048576, 0) + " MB" + vbNewLine
   Case 1024 To 1048575
       GetRAMInfo += FormatNumber(My.Computer.Info.TotalVirtualMemory / 1024, 0) + " KB" + vbNewLine
   Case 0 To 1023
       GetRAMInfo += FormatNumber(My.Computer.Info.TotalVirtualMemory, 0) + " Bytes" + vbNewLine
   Case Else
       GetRAMInfo += "N/A" + vbNewLine
End Select

It's always wrong!

For example, now Windows System Information returns:

Total Virtual Memory = 15.8 GB

Available Virtual Memory = 5.52 GB

While the above code returns:

Virtual Memory: 8,191 GB free of 8,192 GB

(I also use the same above code for My.Computer.Info.AvailableVirtualMemory)

Thanks :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...