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

V8 Memory usage(Stack & Heap)

Deepu K Sasidharan
January 26, 2020
98k

V8 Memory usage(Stack & Heap)

Deepu K Sasidharan

January 26, 2020
Tweet

Transcript

  1. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}

    View full-size slide

  2. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}

    View full-size slide

  3. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Employee:new
    this
    name “John”
    salary 5000
    sales 5
    Object

    View full-size slide

  4. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Employee:new
    this
    name “John”
    salary 5000
    sales 5
    Object
    name “John”
    salary undefined
    sales undefined
    bonus undefined

    View full-size slide

  5. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Employee:new
    this
    name “John”
    salary 5000
    sales 5
    Object
    name “John”
    salary 5000
    sales undefined
    bonus undefined

    View full-size slide

  6. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Employee:new
    this
    name “John”
    salary 5000
    sales 5
    return
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined

    View full-size slide

  7. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined

    View full-size slide

  8. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage undefined
    bonus undefined

    View full-size slide

  9. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage undefined
    bonus undefined
    getBonusPercentage
    salary 5000
    percentage undefined

    View full-size slide

  10. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage undefined
    bonus undefined
    getBonusPercentage
    salary 5000
    percentage 500

    View full-size slide

  11. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage undefined
    bonus undefined
    getBonusPercentage
    salary 5000
    percentage 500
    return 500

    View full-size slide

  12. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage 500
    bonus undefined

    View full-size slide

  13. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage 500
    bonus 2500

    View full-size slide

  14. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus undefined
    findEmployeeBonus
    salary 5000
    noOfSales 5
    bonusPercentage 500
    bonus 2500
    return 2500

    View full-size slide

  15. V8 Memory usage
    Heap memory
    Stack memory
    Global frame
    getBonusPercentage
    findEmployeeBonus
    Employee
    BONUS_PERCENTAGE 10
    john
    Function
    getBonusPercentage(...) {...}
    Function
    findEmployeeBonus(...) {...}
    Class
    Employee {...}
    Object
    name “John”
    salary 5000
    sales 5
    bonus 2500

    View full-size slide