javamemoryjvmheap-memorystack-memory

Heap vs Stack vs Perm Space



Solution

  • Simply

    For example:

    Student std = new Student();
    

    after executing the line above memory status will be like this.