开发者

What is String Local Memory in Java?

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

Thanks


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


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜