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

    View full-size slide

  2. JVM Memory usage
    Heap memory
    Thread Stack
    main

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide