aspose file tools*
The moose likes Java in General and the fly likes Methods memory allocation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Methods memory allocation" Watch "Methods memory allocation" New topic
Author

Methods memory allocation

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 207

Hi all,
I want to know the difference between the way that static and non-static methods are allocated memory.
Thanks....
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18165
    
    8

There isn't a difference.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7081
    
  16

Sudhanshu Mishra wrote:I want to know the difference between the way that static and non-static methods are allocated memory.

Why?

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
Siva Vulchi
Ranch Hand

Joined: Nov 17, 2011
Posts: 30
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Methods memory allocation
 
Similar Threads
static methods
static methods
Methods
static variables memory
Static methods