memorystatus() explanation please in swap section

Windows specific forum
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

memorystatus() explanation please in swap section

Post by sartic »

; #PB_System_TotalSwap : the total Swap memory size, in bytes (Windows And Linux only)
; #PB_System_FreeSwap : the available Swap memory size, in bytes (Windows And Linux only)
; #PB_System_PageSize : the memory page size, in bytes (usually 4KB).

Totalswap is not size of pagefile.sys?!
Trying to read used size of swap in win7
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: memorystatus() explanation please in swap section

Post by IdeasVacuum »

Not sure about Swap Space, but #PB_System_TotalPhysical does not return the Total Physical RAM, it returns the MAX RAM available to apps (The system has it's own allocation of RAM taken from the total physical RAM).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

Re: memorystatus() explanation please in swap section

Post by sartic »

; #PB_System_TotalPhysical: the total amount of installed memory, in bytes
; #PB_System_FreePhysical : the available memory, in bytes
; #PB_System_TotalVirtual : the total virtual memory size, in bytes (Windows only)
; #PB_System_FreeVirtual : the available virtual memory size, in bytes (Windows only)
; #PB_System_TotalSwap : the total Swap memory size, in bytes (Windows And Linux only)
; #PB_System_FreeSwap : the available Swap memory size, in bytes (Windows And Linux only)
; #PB_System_PageSize : the memory page size, in bytes (usually 4KB).

it is RAM usable (example under 32bit of Windows i have 2,75GB of 4GB).
one 32bit program can not handle more than 2GB (i read somewhere that on Vista/7 it can handle 3GB)
virtual memory i can not comprehend but swap is something wrongly named i guess :)
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: memorystatus() explanation please in swap section

Post by Thorium »

If totalphysical and totalswap do not return the total physical ram and size of swapfile there is something wrong. They should be returned and can be retrieved with API with the same names on windows.
The memory your app can use is the virtual memory.
sartic wrote: virtual memory i can not comprehend
Virtual memory is the virtual address space of your process. Every process has it's own address space. Inside that address space the OS mapps physical memory, swap memory, files, etc.
It's also what limits your process to 2GB on 32bit. Thats the total size of the virtual memory address space. Can be tuned to 3GB, also on XP.
Post Reply