Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JVM Memory usage(Stack vs Heap)

JVM Memory usage(Stack vs Heap)

Deepu K Sasidharan

January 23, 2020
Tweet

More Decks by Deepu K Sasidharan

Other Decks in Education

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  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 bonus null this name salary sales return void
  7. 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
  8. 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
  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 findEmployeeBonus john salary 5000 noOfSales 5 getBonusPercentage salary 5000
  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 getBonusPercentage salary 5000 percentage 500
  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 percentage 500 return 500
  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 bonusPercentage 500 bonus 2500
  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 bonusPercentage 500 bonus 2500 return 2500
  14. 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
  15. 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
  16. 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