Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7123493

(proxy) Proxy.getProxyClass doesn't scale under high load

XMLWordPrintable

    • b89
    • x86
    • linux
    • Verified

        FULL PRODUCT VERSION :
        This has been a production critical problem since October 2007.

        It is still a problem in:

        java version "1.7.0"
        Java(TM) SE Runtime Environment (build 1.7.0-b147)
        Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        2.6.38-gentoo-r5 #1 SMP PREEMPT Wed May 11 20:18:51 UTC 2011 x86_64 Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz GenuineIntel GNU/Linux

        A DESCRIPTION OF THE PROBLEM :
        The Proxy class has poor performance under multi-threaded environments

        http://sesat.no/projects/sesat-commons/commons-reflect/
         has a ConcurrentProxy implementation that is basically a copy of Proxy but
        changes the caching mechanism from using a HashMap surrounded with hard synchronization to a ConcurrentMap.

        This has been used intensely, and was a necessity, in production at
        http://sesam.no
        http://sesam.se
        http://finn.no

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Use Proxy.getProxyClass(..) under very high concurrency.

        (It's rather obvious that any HashMap+synchronised-block will lock up under high concurrency).

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Decent performance under high concurrency.
        ACTUAL -
        Poor performance, or complete lock up of the jvm.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        CUSTOMER SUBMITTED WORKAROUND :
        Replace all occurrences of Proxy with ConcurrentProxy from the project "commons-reflection" hosted at https://github.com/finn-no/commons-reflection
        See: https://bugs.openjdk.java.net/show_bug.cgi?id=100120
        Copied from http://bugs.openjdk.java.net/show_bug.cgi?id=100120
        Description From Mck 2009-11-09 04:46:47 PDT

        The Proxy class has poor performance under multi-threaded environments

        http://sesat.no/projects/sesat-commons/commons-reflect/
         has a ConcurrentProxy implementation that is basically a copy of Proxy but
        changes the caching mechanism from using a Hashtable to a ConcurrentMap.

        This has been used intensely, and was a necessity, in production at
        http://sesam.no & http://sesam.se

        Comment #1 From Mck 2009-11-09 04:48:30 PDT

        Patch (file) in the url field

        Comment #2 From Mck 2011-12-21 00:30:59 PDT

        > has a ConcurrentProxy implementation that is basically a copy of Proxy but
        > changes the caching mechanism from using a Hashtable to a ConcurrentMap.
        >

        Correction: It's a HashMap with synchronized statements that are being replaced
        with a ConcurrentMap.

        Comment #3 From ###@###.### 2011-12-21 00:46:24 PDT

        I would suggest bringing this up on ###@###.### for
        discussion.

        Comment #4 From Mck 2011-12-21 01:49:25 PDT

        code now hosted at https://github.com/finn-no/commons-reflection

        Comment #5 From Mck 2011-12-22 04:09:53 PDT

        cross-reference: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7123493

        i subscribed to core-libs-dev and posted but it doesn't look like it's getting
        through.

        Comment #6 From rogerl 2011-12-30 14:09:37 PDT

        (In reply to comment #5)
        > cross-reference: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7123493
        >
        > i subscribed to core-libs-dev and posted but it doesn't look like it's getting
        > through.

        Ensure that you have completed the registration, following the instructions in
        the email sent shorty after you registered. Also, you may need to send mail to
        the alias in plain text, it has been seen that sending mail in HTML will
        prevent the mail from being accepted.

        -Roger

        Comment #7 From Tim Bell 2012-07-06 17:01:58 PDT

        Closing. This is SUNBUG 7123493

              plevart Peter Levart
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: