Windows Develop Bookmark and Share   
 index > Windows Forms General > Total Physical Memory mismatch
 

Total Physical Memory mismatch

I have developed a VB app using visual basic 6. This will display the total physical memory in the system and other configuration details.

My system has 512 MB physical memory. If i open My Computer --> Properties, it shows 512 MB of RAM.

But my app shows only 511.01 MB. Why this difference ?

I am using the following Win32 API in my app for getting the total physical memory:

Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)

The function for getting the total physical memory is

Private Function GetMemory() As String
Dim BytesTotal As Double
Dim memInfo As MEMORYSTATUS

GlobalMemoryStatus memInfo
BytesTotal = memInfo.dwTotalPhys
GetMemory = Format(CStr((BytesTotal / 1024) / 1024), "0.00")

End Function


Any help is highly appreciated. Please help me...

Thanks in advance.
Ramkumar Vijaychandran  Friday, August 04, 2006 9:20 AM
Sorry but this is forum does not cover VB6.0, only VB2003 and higher (.NET 1.0 +)
ahmedilyas  Saturday, August 05, 2006 2:18 AM
Sorry but this is forum does not cover VB6.0, only VB2003 and higher (.NET 1.0 +)
ahmedilyas  Saturday, August 05, 2006 2:18 AM
That's, roughly, how much memory Windows has left to work with after your BIOS gets copied to RAM ("shadowed" is the common term) during the boot sequence...
nobugz  Saturday, August 05, 2006 4:07 AM
It always returns AVAILABLE memory. My system returns 510MB.
dachute  Wednesday, September 16, 2009 2:31 AM

You can use google to search for other answers

Custom Search

More Threads

• Generic Drag and Drop (no hardcoding source in target's events)
• Flow LayoutStyle bug?
• Datagridview and Insert sql command
• Win Forms converted from VS2003 - 2005 but no visual styles showing when app is run
• MessageBox problems
• Datagridview with a custom query?
• using Microsoft UIP Application Block
• Async Problem: Delay adding TabPage to TabControl
• DISPLAY IMAGE ACCORDING TO SCREEN RESOLATION & ROTATE
• sreamreader, txt files