JVM Memory usage(Stack vs Heap)

JVM Memory usage(Stack vs Heap)

7f408bc67dc9ae3b288ee92d16d3c4c2?s=128

Deepu K Sasidharan

January 23, 2020
Tweet

Transcript

  1. JVM Memory usage Heap memory Thread Stack

  2. JVM Memory usage Heap memory Thread Stack main

  3. JVM Memory usage Heap memory Thread Stack main Employee:new Employee

    instance String instance “John” Integer instance 5000 Integer instance 5 name null salary null sales null bonus null this name salary sales
  4. JVM Memory usage Heap memory Thread Stack main Employee:new Employee

    instance String instance “John” Integer instance 5000 Integer instance 5 name null salary null sales null bonus null this name salary sales
  5. JVM Memory usage Heap memory Thread Stack main Employee:new Employee

    instance String instance “John” Integer instance 5000 Integer instance 5 name salary null sales null bonus null this name salary sales
  6. JVM Memory usage Heap memory Thread Stack main Employee:new Employee

    instance String instance “John” Integer instance 5000 Integer instance 5 name salary sales null bonus null this name salary sales
  7. JVM Memory usage Heap memory Thread Stack main Employee:new Employee

    instance String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null this name salary sales
  8. JVM Memory usage Heap memory Thread Stack main Employee:new Employee

    instance String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null this name salary sales return void
  9. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null john
  10. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null findEmployeeBonus john salary 5000 noOfSales 5
  11. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null findEmployeeBonus john salary 5000 noOfSales 5 getBonusPercentage salary 5000
  12. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null findEmployeeBonus john salary 5000 noOfSales 5 getBonusPercentage salary 5000 percentage 500
  13. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null findEmployeeBonus john salary 5000 noOfSales 5 getBonusPercentage salary 5000 percentage 500 return 500
  14. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null findEmployeeBonus john salary 5000 noOfSales 5 bonusPercentage 500 bonus 2500
  15. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus null findEmployeeBonus john salary 5000 noOfSales 5 bonusPercentage 500 bonus 2500 return 2500
  16. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus john Integer instance 2500
  17. JVM Memory usage Heap memory Thread Stack main Employee instance

    String instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus john return void Integer instance 2500
  18. JVM Memory usage Heap memory Thread Stack Employee instance String

    instance “John” Integer instance 5000 Integer instance 5 name salary sales bonus Integer instance 2500