how to find RAM size of system by using java

how to find RAM size of system by using java
[51 byte] By [blvrka] at [2007-10-2 21:07:38]
# 1

> how to find RAM size of system by using java

That's platform dependant, so you can't do it directly in (pure) Java.

A possibility would be to call some native C/C++ code from Java using JNI:

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

Good luck.

prometheuzza at 2007-7-13 23:53:20 > top of Java-index,Java Essentials,New To Java...
# 2

I don't think there is an API for that. Not all systems even necessarily have that information available to user processes (such as "Classic Unix" which doesn't have a system call for it.) On some multi-CPU architectures (NUMA, cluster, grid) the question might not even have an obvious answer.

Why do you need that? What are you trying to do?

sjasjaa at 2007-7-13 23:53:20 > top of Java-index,Java Essentials,New To Java...
# 3
I am doing one application .before installing that application i want to check the RAM size and How much free space available in harddisk i will check.but this will done by java program
blvrka at 2007-7-13 23:53:20 > top of Java-index,Java Essentials,New To Java...