I forgot to add the usage of the program: $ java --XX:MaxPermSize=512m -XX:PermSize=512m st : <GCH: survsize=576 > <GCH: edensize=5056 > GC monitor thread started on port 12346. Connect to this port to run GC. time for trace: 332 time for trace: 15 time for trace: 15 time for trace: 19 time for trace: 18 time for trace: 20 : time for trace: 1344 time for trace: 1654 time for trace: 2217 time for trace: 1672 time for trace: 1977 time for trace: 1467 time for trace: 1851 time for trace: 1645 time for trace: 2099 // do_stack_trace_op() becomes really slow as StrintTable is filled. // But as soon as I do System.gc(), it becomes fast. time for trace: 1372 time for trace: 1769 Performing System.gc()...<GC: 2 2 3322.191202 5 0 31 1245328 0 5242880 320 0 589824 90880 91192 12779520 188790400 1332304 536870912 1.537019 1.537019 > done. time for trace: 5 time for trace: 7 time for trace: 8 time for trace: 9 time for trace: 11 time for trace: 11
-----Original Message----- From: Vincent Shek [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 5:12 PM To: Logging General Subject: Problem with String.intern() in CategoryKey Hi all, I hesitate to send this email to this list as opposed to Bugzilla but I would to get some opinion here first before I do so. I am facing a strange performance problem in our production environment when I use the conversion pattern "C:L" to output class name and line number. I DO expect the performance to be slower but what I got was a gradual slowdown where our application would literally slow down to a grinding halt after a few days of running. The application would get back to normal if I force it to run a full GC. After working with HP JVM engineer on this issue, the problem was found to be the use of String.intern() in CategoryKey class AND the use of java.lang.Throwable.getStackTraceElement() (to get line number and classname). The use of intern() causes the StringTable in JVM (in the Permanent heap) to fill up very quickly as each call to Logger.getLogger() will create an instance of CategoryKey object. The method getStackTraceElement() will use the StringTable for lookup and it will take longer for it to run as time goes. The StringTable may contain Strings which are not live in the java program. However, the collection of Strings in StringTable is done only in Full GC. That's the reason a Full GC recovered the application performance. I have attached a sample program that will reproduce the problem easily on any platforms using 1.4.2 JVM. My question to the logging group is whether the call to intern() is necessary in creating the CategoryKey? Is it used to speed up hash lookup? This seems like a VM bug but I doubt it will get fixed by Sun anytime soon and I am worried that other system will experience the same problem I do. (took us a few weeks to figure out the problem!) TIA for your help, Vincent Shek This email is confidential. If you are not the intended recipient, please notify the sender immediately. The unauthorized use, disclosure, dissemination or copying of this email is prohibited. Emails are susceptible to alteration and their integrity cannot be guaranteed. Tai Fook Securities Group " Tai Fook" does not accept liability for damage caused by this email. This email is confidential. If you are not the intended recipient, please notify the sender immediately. The unauthorized use, disclosure, dissemination or copying of this email is prohibited. Emails are susceptible to alteration and their integrity cannot be guaranteed. Tai Fook Securities Group " Tai Fook" does not accept liability for damage caused by this email.
