• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA Heap Size vs Java Thread Stack

 
Arunkumar Subramaniam
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends

what is the difference and reliationship between jvm heap size and java thread statck memory


Thanks
Arunkumar S
 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi -

The Java Heap is where objects get created. When you call new Object() (not just java.lang.Object, but any object), it gets created on the heap. When too many objects are on the heap, the JVM tries to garbage collect any unused references. The thread stack deals with methods and their call stacks. When a thread calls a method, it pushes the call onto the stack. If that method calls another method, it gets pushed onto the stack. When the method execution completes, the method call is popped off the stack. A good article on the JVM architecture can be found here http://www.artima.com/insidejvm/ed2/jvm2.html.

Hope this helps,
Jeff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic