code: private void poll()
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          // Note: A ReferenceQueue is thread safe and may be accessed concurrently
          //       from multiple threads. However, a BeanO should only be destroyed
          //       on a single thread, which is fine since its key will be returned
          //       from poll() only once.
  
          BeanO bean = null;
          int removeCount = 0;
          Reference<? extends EJSWrapperBase> ref;
          while ((ref = ivRefQueue.poll()) != null)
          {
              synchronized (ivCache)
              {
                  bean = ivCache.remove(ref);
              }
              ++removeCount;
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "poll : removed (" + ref + ", " + bean + ")");
  
              // It is possible a bean was removed during clear, and yet the
              // wrapper is still on the reference queue, so handle null.
              if (bean != null) {
                  bean.destroy();
              }
          }
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "poll : size = " + ivCache.size() + ", removed = " + removeCount);
      }
docs: Removes all values from the cache whose key has been garbage collected. <p>
  
  When a value is removed from the cache, it is destroyed (i.e PreDestroy
  is called).