0

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

4 Answers 4

5

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).

Sign up to request clarification or add additional context in comments.

Comments

3

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.)

5 Comments

This was Question asked in an Interview by a Java Architect . Still in search of this strange terminology :)
Jon is there any other memory in JVM excluding this Method Area ,Stack ,Heap , Temp and Registry ?
@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.
Thanks , i would to know which part of memory does Return types in Java is Stored ?
@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.
3

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.

Comments

2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.