• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Stack n heap
 

 

Statistics

Views

Total Views
741
Views on SlideShare
741
Embed Views
0

Actions

Likes
0
Downloads
7
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Stack n heap Stack n heap Presentation Transcript

    • Disclaimer: This presentation is prepared bytrainees of baabtra as a part of mentoringprogram. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte SystemTechnologies Pvt . Ltd
    • HEAP AND STACK vishnu.padinjattedath@gmail.com @Vishnu_Kishor
    • BASICS• The JVM divided the memory into following sections. – Heap – Stack – Code – Static• This division of memory is required for its effective management
    • • The code section contains your bytecode.• The Stack section of memory contains methods, local variables and reference variables.• The Heap section contains Objects (may also contain reference variables).• The Static section contains Static data/methods.
    • • Of all of the above 4 sections, you need to understand the allocation of memory in Stack & Heap the most, since it will affect your programming efforts.
    • Difference between instance variables and local variables• Instance variables are declared inside a class but not inside a method class Student{ <strong>int num; // num is instance variable</strong> public void showData{}
    • • Local variables are declared inside a method including method arguments. 1public void sum(int a) { int x = int a + 3; // a , x are local variables</strong> }
    • VARIABLE DECLARATION• Allocation of some RAM memory to variable.• Three aspects saved in memory – the name of the variable, – the data type of the variable and – the value of the variable.
    • STACK : DEFENITION• The Stack section contains – methods, – local variables and – reference variables.• The info: required to resume the execution of these functions is stored in the stack.• Provides static memory allocation
    • HEAP : DEFENITION• The memory used by programs to store global variables.• All global variables are stored in heap memory• When that function exits, the heap memory used by each local variable is freed.• Dynamic memory allocation
    • Thank you
    • Did this presentation help you??? do visit our page facebook.com/baabtra and like us.www.baabtra.com |www.massbaab.com |www.baabte.com |
    • Contact Us