While running java application I\'m getting the following memory dump.
After installing java 8(with java 7 application was working before) I started getting the below er
Java, by default, does not uses all avalaible memory. You need to run the application with the corresponding parameters.
See this question to all the details. (It can change with the version of Java).
The parameter setting can be set on the command line but if you use an application you may have some configuration file. For example, in Eclipse you have eclipse.ini where you an set your memory preferences.
Some programs use a lot of memory, like Elasticsearch, try to add more memory if you use this kind of memory intensive program
I was getting the similar memory dumps while running the same java application on Windows 10 and 8.1(both 64 bit).
Windows 8.1
32GB RAM
i7-4790 3.60GHz CPU
Paging file size(fixed, 14GB)
Windows 10
16GB RAM
i7-4790 3.60GHz CPU
Paging file size(automatically managed, initially was fixed, 14GB)
1st issue was that with identical hardware(the difference in RAM only and OS), application on Windwos 10 was crashing almost instantly. The most surprising thing, that in Task manager I saw that only 25% of RAM is used.
After searching info in google, I've found that:
2nd issue
As was mentioned by @borjab
Java, by default, does not uses all available memory.
To get a help on non-standard options for Java type in your CMD:
java -X
Output:
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
<size>
can be defined in
G - Gigabytes
M - Megabytes
K - Kilobytes
The final solution for both OS was:
java -Xmx15G -Xms15G -jar selenium-server-standalone-3.4.0.jar
My initial java version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
Updated java version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
Your application, by default, does not use all the available system memory (or RAM). The limit depends on the xmx value you have set.
Not sure if 64 bit is an option for you, if it is, this lets you increase your xmx more than the 32 bit version.