Return-Path: Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: (qmail 58796 invoked from network); 12 Feb 2011 23:58:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Feb 2011 23:58:19 -0000 Received: (qmail 21583 invoked by uid 500); 12 Feb 2011 23:58:19 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 21413 invoked by uid 500); 12 Feb 2011 23:58:18 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 21405 invoked by uid 99); 12 Feb 2011 23:58:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Feb 2011 23:58:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Feb 2011 23:58:17 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 924391A1C85 for ; Sat, 12 Feb 2011 23:57:57 +0000 (UTC) Date: Sat, 12 Feb 2011 23:57:57 +0000 (UTC) From: "Chuck Williams (JIRA)" To: java-dev@axis.apache.org Message-ID: <997743160.13248.1297555077595.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <786272495.13202.1297547637509.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (AXIS2-4957) ServiceTCCL composite breaks class caching in java reflection, jboss serialization, ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-4957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chuck Williams updated AXIS2-4957: ---------------------------------- Attachment: AXIS2-4957.patch Patch to fix AXIS2-4957: Cache composite ServiceTCCL so that it is reused rather than reconstructed for every web service operation. This is essential to ensure ClassLoader-indexed class-caching schemes work, e.g. that in java reflection. This is a purely performance change with no visible functional impact. E.g., it ensures accessor classes generated by java reflection are available for reuse, speeding up reflection by over 10x and eliminating perm gen space garbage/bloat. However, functionally, java reflection appears the same whether it regenerates accessor classes every time (no caching) or reuses these classes (caching). As there is no observable functional impact it is hard to verify the change with a junit test. No junit test included with this fix. > ServiceTCCL composite breaks class caching in java reflection, jboss serialization, ... > --------------------------------------------------------------------------------------- > > Key: AXIS2-4957 > URL: https://issues.apache.org/jira/browse/AXIS2-4957 > Project: Axis2 > Issue Type: Bug > Components: kernel > Affects Versions: 1.5.4, nightly > Reporter: Chuck Williams > Assignee: Chuck Williams > Attachments: AXIS2-4957.patch > > > Setting ServiceTCCL parameter to composite gives threads executing request operations access to classes loaded by either the default thread context class loader or the service class loader. AbstractMessageReceiver resets the thread's context class loader to a composite class loader that consults both of these sources on every invocation. The current code does this by constructing a new composite class loader every time. This has catastrophic performance consequences if the request-processing thread makes extensive use of java reflection or other class-caching mechanisms such as jboss serialization. > Class caching in java reflection and generally other places is indexed to the class loader. By creating a new composite class loader for every request processed by a service, these requests get no class caching! This slows down java reflection, jboss serialization, etc., by over an order of magnitude and bloats perm gen space with unnecessary generated classes (java reflection accessor classes, jboss serialization ClassMetaData, etc.). New classes are generated for every request unnecessarily. The performance of java reflection in particular is dependent on effective caching of its generated accessor classes. In an actual axis2 application the bloat increased perm gen space from about 80 meg to over 2 Gig and java reflection accessor class regeneration became the primary performance bottleneck. > The fix is simple: cache and reuse the composite ServiceTCCL. > I'm testing a patch with the fix now and will upload when verified. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org