2

Is there any API's in windows, to get the RAM memory info like...Total RAM, Available RAM , shared RAM, buffered RAM, total swap space size)

I have checked in msdn meorymangement API's, but couldn't find much info.

Can anyone guide me on this.

user2713021
  • 81
  • 1
  • 5
  • What's the point of tagging `linux`? – ta.speot.is Oct 01 '13 at 09:09
  • sorry by mistake....actually this is the application which porting fro Linux to Windows.so the same data structure available in Linux (sysinfo structure) need to be filled in Windows as well – user2713021 Oct 01 '13 at 09:12
  • Does this answer your question? [How to get available RAM on Windows?](https://stackoverflow.com/questions/63391433/how-to-get-available-ram-on-windows) – DevSolar Aug 13 '20 at 09:02

1 Answers1

0

The GlobalMemoryStatusEx function provides high-level information of that kind. See the documentation for the MEMORYSTATUSEX structure for a description of what is reported.

Jon
  • 428,835
  • 81
  • 738
  • 806
  • We can get the Total and Available Memory info, what about shared RAM and Buffred RAM info? – user2713021 Oct 01 '13 at 09:15
  • @user2713021: I don't believe such information is available. Note that the man page for `sysinfo` clearly states *"This function is Linux-specific, and should not be used in programs intended to be portable."*; since you are not following this suggestion, some turbulence is to be expected. – Jon Oct 01 '13 at 09:19