B4J Question How to know how many ram is installed

electro179

Active Member
Licensed User
Hello

For my program with B4J, I need to know how many RAM is installed in the computer.

How can i do it ?

thank you
 

udg

Expert
Licensed User
You could find it yourself applying the proper method for the OS your program is running on.
Windows: use "wmic" (eg. wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Tag)
Linux: use "dmidecode" (eg. dmidecode -t 17 | grep "Size.*MB" | awk '{s+=$2} END {print s / 1024}')
MacOS: use "SPHardwareDataType" (eg. /usr/sbin/system_profiler SPHardwareDataType | grep " Memory:")

All methods above untested. I just searched the Internet.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Please come back and let oss know how you used it. The greatest thing with a mind of your own is that someone else likes to do the thinking for you :)
 
Upvote 0
Top