Questions regarding Java string literal pool

2016-11-03 Thread Jun Zhuang
Hi, I have a few questions related to the Java String pool, I wonder if I can get some clarification from the experts? 1. Location of the String pool Following are from some of the posts I read but with conflicting information: · http://java-performance.info/string-intern-in-ja

Questions regarding Java string literal pool

2016-10-13 Thread Jun Zhuang
Hi, I have a few questions related to the Java String pool, I wonder if I can get some clarification from the experts? 1. Location of the String pool Following are from some of the posts I read but with conflicting information: · http://java-performance.info/string-intern-in-ja

Re: Java string literal pool

2016-08-30 Thread Krystal Mok
Comments inline below: On Tue, Aug 30, 2016 at 6:38 AM, Jun Zhuang wrote: > Hi Kris, > > > > Thanks for the response. Regarding the 2nd question, I want to make sure > I understand your answer. The handling of *new String("Cat")* can be > broken into two steps: > > > > *Step #1*: Handling the “

RE: Java string literal pool

2016-08-30 Thread Jun Zhuang
Hi Kris, Thanks for the response. Regarding the 2nd question, I want to make sure I understand your answer. The handling of new String("Cat") can be broken into two steps: Step #1: Handling the “Cat” expression If ( Does not already exist ) Create an instance on the heap Add a reference to the

Re: Java string literal pool

2016-08-29 Thread Krystal Mok
Hi Jun, Comments below inline: On Mon, Aug 29, 2016 at 6:29 AM, Jun Zhuang wrote: > Hi, > > > > I was reading about the Java8 Metaspace the other day, then got into the > topic of string pool. I got conflicting information regarding a couple of > things, I wonder if I can get a definitive answe

Java string literal pool

2016-08-29 Thread Jun Zhuang
Hi, I was reading about the Java8 Metaspace the other day, then got into the topic of string pool. I got conflicting information regarding a couple of things, I wonder if I can get a definitive answer from the experts? #1: Is the string literal/constant pool a heap area that holds actual string