• Post Reply Bookmark Topic Watch Topic
  • New Topic

Methods memory allocation  RSS feed

 
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to know the difference between the way that static and non-static methods are allocated memory.
Thanks....
 
Sheriff
Posts: 22846
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't a difference.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhanshu Mishra wrote:I want to know the difference between the way that static and non-static methods are allocated memory.

Why?

Winston
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no difference at all.

For each thread, there will be a stack that holds state of method invocations(or stack frames).The state of a Java method invocation includes its local variables, method arguments, its return value and intermediate calculations. While executing a particular method by a thread, it creates stack frame entry on to the stack and executes the code logic using pc registers. And size of stack frame for any method is decided at run time but does not depend on method type.

Siva

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!