Giter VIP home page Giter VIP logo

jdk's Introduction

OpenJDK jdk

This github repository is a mirror that combines many of the official OpenJDK mercurial repositories, by using a separate git branch to represent each individual mercurial repository.

It is not currently being maintained. This other mirror might be more helpful.

jdk's People

Contributors

gfredericks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jdk's Issues

Empty Repo

Is this project stalled? Need any help with this?

When we create a lot of Strings, CoderResult$Cache.get() becomes the bottleneck.

I got a lot of this kind of thread dump during a load test:

"catalina-exec-458" #26857 daemon prio=5 os_prio=0 tid=0x00007f56a01ab800 nid=0x2517 waiting for monitor entry [0x00007f53d38f7000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at java.nio.charset.CoderResult$Cache.get(CoderResult.java:201)
        - waiting to lock <0x00000005c0e89b58> (a java.nio.charset.CoderResult$1)
        at java.nio.charset.CoderResult$Cache.access$200(CoderResult.java:194)
        at java.nio.charset.CoderResult.malformedForLength(CoderResult.java:236)
        at sun.nio.cs.UTF_8$Decoder.malformedN(UTF_8.java:147)
        at sun.nio.cs.UTF_8$Decoder.decode(UTF_8.java:473)
        at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:153)
        at java.lang.StringCoding.decode(StringCoding.java:193)
        at java.lang.StringCoding.decode(StringCoding.java:254)
        at java.lang.String.<init>(String.java:546)
        at java.lang.String.<init>(String.java:566)

The cache has a synchronized method get(int len). Can we optimize this? Replace this with a lock-free cache?


private static abstract class Cache {

        private Map<Integer,WeakReference<CoderResult>> cache = null;

        protected abstract CoderResult create(int len);

        private synchronized CoderResult get(int len) {
            if (len <= 0)
                throw new IllegalArgumentException("Non-positive length");
            Integer k = new Integer(len);
            WeakReference<CoderResult> w;
            CoderResult e = null;
            if (cache == null) {
                cache = new HashMap<Integer,WeakReference<CoderResult>>();
            } else if ((w = cache.get(k)) != null) {
                e = w.get();
            }
            if (e == null) {
                e = create(len);
                cache.put(k, new WeakReference<CoderResult>(e));
            }
            return e;
        }

    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.