[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#275547: String.intern() has a very low capacity (<64k)



Hi, here I am again,

Curious...:

$ cat Test.java
class Test
{
        public static void main(String[] argv)
        {
                for (char i = '\u0001'; i <= '\uffff'; i++) {
                        char[] ca = { i };
                        System.out.println("Interning the "+((int)i)+"th String now...");
                        (new String(ca)).intern();
                }
        }
}
$ gcj -o Test --main=Test Test.java  && ./Test > log
<busyloop!>
<Ctrl-C>
$ tail -1 log
Interning the 8192th String now...
$

Hm, this is exactly 2^13

--Jeroen

-- 
Jeroen van Wolffelaar
jeroen@wolffelaar.nl
http://jeroen.A-Eskwadraat.nl



Reply to: