I am using Eclipse. The problem is that my application crashes if the allocated memory is less than 512 MB. Now, all the same, you need to check the available memory for the program before starting the full processing of the full memory? For example, I know that we can check the available JVM heap size as:
long heapSize = Runtime.getRuntime().totalMemory();
System.out.println("Heap Size = " + heapSize);
The problem is that this gives the JVM heap size. Even increasing it does not work using Eclipse. In Eclipse, if I change the arguments of a VM, then it works. However, the listing from previous statements is always the same. Is there any command through which I can find out exactly how much memory is allocated for a particular application?
source
share