There are five main memory areas which are used to various Java elements. Following is the list of the same.
Class Area - This area contains the static members of the class.
Method Area - This area contains the method definition and executable code.
Heap Area - This area contains the objects which are dynamically allocated/deallocated. if an object is no more referenced by any live reference it is deallocated.
Stack Area - This area contains the local variables.
Pool Area - Contains immutable objects like string.