Golang Memory usage(Stack vs Heap)

Golang Memory usage(Stack vs Heap)

7f408bc67dc9ae3b288ee92d16d3c4c2?s=128

Deepu K Sasidharan

February 12, 2020
Tweet

Transcript

  1. Go Memory usage Heap Goroutine stack P1 mcache main frame

    BONUS_PERCENTAGE 10
  2. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 Employee:new name “John” salary 5000 sales 5 bonus 0
  3. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10
  4. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5
  5. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 0
  6. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 0 getBonusPercentage salary 5000
  7. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 0 getBonusPercentage salary 5000 percentage 500
  8. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 0 getBonusPercentage salary 5000 percentage 500 return 500
  9. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 500
  10. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 500 bonus 2500
  11. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 findEmployeeBonus salary 5000 noOfSales 5 bonusPercentage 500 bonus 2500 return 2500
  12. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 mspan Employee name “John” salary 5000 sales 5 bonus 2500
  13. Go Memory usage Heap Goroutine stack P1 mcache main frame

    john BONUS_PERCENTAGE 10 mspan Employee name “John” salary 5000 sales 5 bonus 2500