New MemoryStatus Type

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Blankname
Enthusiast
Enthusiast
Posts: 120
Joined: Sun Oct 14, 2012 9:11 am

New MemoryStatus Type

Post by Blankname »

I'm testing the new commands, and figured #PB_System_UsedPhysical would serve as a good addition to the new MemoryStatus() function. It should be extremely simple to implement using the existing #PB_System_TotalPhysical and #PB_System_FreePhysical types (#PB_System_UsedPhysical = #PB_System_TotalPhysical - #PB_System_FreePhysical). In the meantime you can simply do something like this.

Code: Select all

Debug "Total System Memory: " + StrF(MemoryStatus(#PB_System_TotalPhysical)/1073741824, 2) + " GB"
Debug "Available System Memory: " + StrF(MemoryStatus(#PB_System_FreePhysical)/1073741824, 2) + " GB"
Debug "Used System Memory: " + StrF(MemoryStatus(#PB_System_TotalPhysical)/1073741824 - MemoryStatus(#PB_System_FreePhysical)/1073741824, 2) + " GB"