The Java Virtual Machine (JVM) enables Java byte codes to run on a physical machine. The Java Virtual Machine ideally will not allow any harm to come to the computer because it has no control of the operating system and acts as if it is a separate computer. If a malicious Java program were to crash the Java Virtual Machine the operating system would remain stable.
You can tune the JVM settings to improve performance and avoid memory allocation errors.
Use Admin Console: