--- old/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/Pool.java 2017-06-01 18:21:19.549569604 +0100 +++ new/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/Pool.java 2017-06-01 18:21:19.489569604 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,10 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; + import java.util.concurrent.ConcurrentLinkedQueue; -import java.lang.ref.WeakReference; +import java.lang.ref.SoftReference; + /** * General-purpose object pool. @@ -50,7 +52,7 @@ public abstract class Pool { // volatile since multiple threads may access queue reference - private volatile WeakReference> queue; + private volatile SoftReference> queue; /** * Gets a new object from the pool. @@ -69,7 +71,7 @@ } private ConcurrentLinkedQueue getQueue() { - WeakReference> q = queue; + SoftReference> q = queue; if (q != null) { ConcurrentLinkedQueue d = q.get(); if (d != null) @@ -78,7 +80,7 @@ // overwrite the queue ConcurrentLinkedQueue d = new ConcurrentLinkedQueue(); - queue = new WeakReference>(d); + queue = new SoftReference>(d); return d; }