Skip to content
Advertisement

Tag: stack-memory

Instance created inside of a Method

I have not been able to find any reliable literature on this but i’m curious as to where an object is stored if its created inside of a method ? on the stack or on the heap in java 8? I know that normally only local primitives, reference variables and function calls are stored on the stack and that objects

Need an explanation for apparent heap size reduction

From the GC logs, it appears that the heap size is being reduced across young and old generations after sometime. Below are three entries from the logs. {Heap before gc invocations=5: PSYoungGen total 44800K, used 44180K [0x18220000, 0x1b420000, 0x24a20000) eden space 38400K, 100% used [0x18220000,0x1a7a0000,0x1a7a0000) from space 6400K, 90% used [0x1ade0000,0x1b3853c8,0x1b420000) to space 6400K, 0% used [0x1a7a0000,0x1a7a0000,0x1ade0000) PSOldGen total 51200K,

where is array saved in memory in java?

If I have a function that in that function I declare: Where are arr and the whole array stored? heap? stack? Does it matter if the declaration is in some function or in main()? and let’s say I also have these command lines: where are arr[0] and arr[1] stored? Answer Memory diagram: Boxes are memory locations (where binary numbers can

Java’s enum… Where are they created?

Since enum in C# are on the stack, I was wondering where enum, in Java, where created. On the stack? On the heap? In some mysterious other place? Enumeration in C# are more primitive than those in Java, this might explain why they are created on the stack… Where are they? I can’t find them! Thanks Answer Enums in Java

Java Object Method Stack Frame Parameters

So in java, say you have a non-static method ‘bar()’ in an class ‘Foo’. Say then that you call this method like so: Now the stack frame for the call includes the integer parameter, as well as a ‘this’ parameter to be used as an internal reference to the object. What other interesting parameters are copied to the new stack

Advertisement