You may have come in scenario sometime when you program our cede result in error java memory related error, like could not allocate memory on heap for java, These error may result in OutOfMemoryError exceptions or to a reduction in the performance of the Java application, here is the typical setting for java memory so that you can escape these errors.
There is and command line option for java, that defines the maximum size of memory to be allocated to JVM
-Xmx : this allows application to run with 70% of max memory uses
Lets see the list of Maximum possible heap size and what is recommended for the heap size specification, as this is just a recommendation not a rule you can decide accordingly.