views:

138

answers:

4

In a JVM the memory is split into Method Area ,Stack ,Heap , Temp and Registry . what is String Local Memory ? Does this exists ? If so when does it gets allocated or assigned ? Appropriate Usage of this ?

Thanks

+2  A: 

I've never heard of it before, and a Google search doesn't find any mention of it. Could you tell us where you've heard of "string local memory" for Java? I don't believe it's a standard term.

(I'm not really sure what you mean by "temp" or "registry" either as far as the JVM is concerned.)

Jon Skeet
This was Question asked in an Interview by a Java Architect . Still in search of this strange terminology :)
YetAnotherCoder
Jon is there any other memory in JVM excluding this Method Area ,Stack ,Heap , Temp and Registry ?
YetAnotherCoder
@Srinivas: As I said, I'm not even sure about "temp" and "registry". By "method area" I assume you mean the JITted code. It sounds like this Java architect was getting confused, possibly with the string literal pool as mentioned in the other answer.
Jon Skeet
@Jon Thanks , i would to know which part of memory does Return types in Java is Stored ?
YetAnotherCoder
@Srinivas: Return *types*? It's not really clear what you mean. If you mean return *values*, they usually end up on the stack, when the method returns.
Jon Skeet
+3  A: 

I'm not sure what you mean by the term "String Local Memory", but there is such a thing as String literal pooling in the VM whereby String literals are pooled (and reused). See section 3.10.5 in the Java language spec:

http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100960

The other things you mention above are covered in detail in the Runtime Data Areas section of the VM spec:

http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#1732

Hope that explains a bit more (with correct terminology).

Jon
Thanks for the links Jon :)
YetAnotherCoder
+1 interesting links!
oedo
+1  A: 

Never heard of "string local memory". I've heard of "thread local" memory, though. That's where each thread that accesses a given ThreadLocal object gets a different value, depending entirely on which thread it is. I've yet to need to use it -- feels too magical, if you ask me.

See http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ThreadLocal.html for a bit more detail.

I mention this because "string" and "thread" mean quite similar things in the context of "long, flexible, very very skinny bits of material", and back-and-forth translation could account for the confusion.

cHao
A: 

In a JVM the memory is split into Method Area ,Stack ,Heap , Temp and Registry.

No it isn't. It is split into stacks, the heap, the method area, and the constant pool. See the JVM Specification

what is String Local Memory?

No idea. What are 'Temp' and 'Registry'?

Wherever you got this from it is erroneous.

EJP