cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cristina
Level 3

Check user's RAM

Hi,

I'm using IA 7 and IA 8.

Is there a way to check the user's RAM during installation? if for example the user have low RAM a message would show that he's RAM is lower than the required and the installer will exit.

Please help.


Thanks.:)
Labels (1)
0 Kudos
(2) Replies
tfromm1
Level 7

Available memory can be detected using different sources. They depends on plattform:

e.g.:
Linux: parse output of "free" command
HPUX: parse "top -d 1 -n 1" output
Windows: Little bit tricky here, you have to use a .vbs script to determine the values. I've attached an example .vbs script. (rename it as .vbs)
This you can call via
cscript /Nologo systeminfo.vbs

Starting with JDK 6 you can use the ManagementFactory.getPlatformMBeanServer() to fetch several data like "TotalPhysicalMemorySize" or "TotalPhysicalMemory".
But the available beans and their names depends on JVM vendor.
0 Kudos
plabee
Level 3

There is an all-Java solution. It makes use of open-source libraries that make JNI calls. I was calling systeminfo.exe and parsing the results, but XP Home doesn't have this executable!

Look at http://forums.hyperic.com/jiveforums/thread.jspa?messageID=26633æ ‰ for details.
0 Kudos