Linked Questions
36 questions linked to/from Where are static methods and static variables stored in Java?
3 votes
2 answers
9k views
Where are static variables stored in java? [duplicate]
I want to know where static variables are stored in Java. There are already few questions on SO, like: where is a static method and a static variable stored in java. In heap or in stack memory The ...
1 vote
0 answers
1k views
After Java 8, Where are the static members of a class stored in Java? [duplicate]
Are the static members of a class - static variables, static blocks, and static methods stored in the Metaspace region after Java 8? If not, where are they stored? There is no concrete information ...
0 votes
2 answers
293 views
Is static memory out of the Java heap? [duplicate]
Where are static variables stored? Is there any separate memory for the static variables? I know that they are not a part of the object, are they also not part of the Java heap and store d somewhere? ...
0 votes
2 answers
255 views
Where does the Static members reside in memory,is it permanent generation? [duplicate]
Static members where does they reside. i need an detail explanation of static ,local and instance members memory allocation(variables,methods). Memory management(Is it permanent generation).
2 votes
1 answer
122 views
Where will the object be created in java [duplicate]
Below is a question that was raised by one of my friends during a discussion but both of us didn't know what the actual answer is. public class Test { static int i = 5; static String str = "Welcome"; ...
3 votes
0 answers
124 views
Memory area for Static methods in java [duplicate]
I had studied that the static data members of class are getting memory at class loading time in the class information area (CIA) of class area,but i couldn't find out which memory area is for static ...
2096 votes
41 answers
697k views
Difference between static class and singleton pattern?
What real (i.e. practical) difference exists between a static class and a singleton pattern? Both can be invoked without instantiation, both provide only one "Instance" and neither of them is thread-...
244 votes
6 answers
205k views
PermGen elimination in JDK 8
I have installed JDK 8 and trying to run Eclipse. I am getting following warning message: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 What ...
367 votes
3 answers
302k views
Java heap terminology: young, old and permanent generations?
I'm trying to understand What the concepts of young, old and permanent generations are in the Java heap terminology, and more specifically the interactions between the three generations. My questions ...
126 votes
1 answer
72k views
static allocation in java - heap, stack and permanent generation
I have been lately reading a lot on memory allocation schemes in java, and there have been many doubts as I have been reading from various sources. I have collected my concepts, and I would request to ...
86 votes
5 answers
9k views
Large difference in speed of equivalent static and non static methods
In this code when I create an Object in the main method and then call that objects method: ff.twentyDivCount(i)(runs in 16010 ms) , it runs much faster than calling it using this annotation: ...
38 votes
7 answers
63k views
What is the actual memory place for static variables?
A static variable is allocated for the entire duration of a program's execution, so neither stack nor heap are convenient for it. Then where is that variable? Shouldn't there be some place where it is ...
14 votes
3 answers
28k views
Where java static variables are stored in memory?
class A{ static int i = 10; static int j = 20; static void getname(){ } } Where will these variable be stored in memory ?
11 votes
3 answers
13k views
Permgen is part of heap or not?
I have found picture from official oracle site but in popular SO answer I have found that permanent generation is not part of heap Permanent Generation (non-heap): The pool containing all the ...
9 votes
3 answers
9k views
Static methods loading/unloading and memory area in java?
I have four questions regarding static methods in java: 1) When static methods are loaded in memory? when class loaded or when method get called first time? 2) When static method is unloaded from ...