Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
difference between Heap and Stack memory
#1
Could you please explain the difference between Heap and Stack memory, Do we have any restriction on limitation on each of the memory type,
thanks
Reply
#2
Heap and stack are both memory area. The primitive data types are created on stach whereas objects are created on heap memory area. The stack stores the reference of an object (stored on heap).

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#3
Stack is used for static memory allocation and Heap for dynamic memory allocation, both stored in the computer's RAM .

You can use the stack if you know exactly how much data you need to allocate before compile time and it is not too big. You can use heap if you don't know exactly how much data you will need at runtime or if you need to allocate a lot of data.

More about.......Stack and Heap

Helsy
Reply
#4
Good to see that
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Difference between java netbeans and tomcat 6.0 Xpert 0 2,233 06-23-2011, 11:38 PM
Last Post: Xpert
  Difference between Java and Netbeans 2011 Xpert 0 3,054 05-11-2011, 04:59 PM
Last Post: Xpert
  what is the difference between Static method and the method we write in Clas saneha 1 4,760 04-28-2011, 09:12 PM
Last Post: Vuhelper
  OPERATOR OVERLOADING,UFFER OVERFLOW and MEMORY LEAKAGE,MULTI THREADED and CONCURRENCY saneha 1 2,629 04-28-2011, 08:53 PM
Last Post: Vuhelper
  what is the difference between Java and Java 2EE saneha 1 2,077 04-28-2011, 08:50 PM
Last Post: Vuhelper
  whats the difference in node stream and filter stream? saneha 1 2,773 04-27-2011, 11:00 PM
Last Post: Vuhelper
  What is the difference between Java and Java 2EE saneha 1 1,940 04-27-2011, 06:25 AM
Last Post: Vuhelper
  Explain the difference between 2-tier and 3 tier client server model. saneha 1 7,658 04-27-2011, 06:20 AM
Last Post: Vuhelper
  Difference between Bean, Enterprise Java Bean and Managed Bean saneha 1 2,966 04-27-2011, 06:14 AM
Last Post: Vuhelper
  difference between javaServer pages and javaServer faces saneha 1 2,138 04-26-2011, 11:03 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)