The Java heap is the area of memory used to store objects instantiated by applications running on the JVM. Objects in the heap can be shared between threads. Many users restrict the Java heap size to 2-8 GB in order to minimize garbage collection pauses.
Heap memory should not be greater than physical memory on your system.
Min size of heap memory can be 1/64th sized of system physical memory.
Max size of heap memory can be 1/4th size of system physical memory.
Jave Heap contains New/Young Generation and Old/Tenured Generation.
In New/Young Generation, we have Eden and Survival space. Survivor has two survivor spaces S0 and S1.
Till JDK7, we have perm gen space. From JDK8 onwards, this has been converted to metaspace.