private void destroy(Map<K,  List<ObjectTimestampPair<V>>> m, KeyedPoolableObjectFactory<K, V> factory) {
        for (Iterator<Entry<K,  List<ObjectTimestampPair<V>>>> entries = m.entrySet().iterator(); entries.hasNext();) {
            Entry<K,  List<ObjectTimestampPair<V>>> entry = entries.next();
            K key = entry.getKey();
            List<ObjectTimestampPair<V>> c = entry.getValue();
            for (Iterator<ObjectTimestampPair<V>> it = c.iterator(); it.hasNext();) {
                try {
                    factory.destroyObject(
                            key,it.next().value);
                } catch(Exception e) {
                    // ignore error, keep destroying the rest
                } finally {
                    synchronized(this) {
                        ObjectQueue objectQueue =
                                _poolMap.get(key);
                        if (objectQueue != null) {
                            objectQueue.decrementInternalProcessingCount();
                            if (objectQueue.internalProcessingCount == 0 &&
                                    objectQueue.activeCount == 0 &&
                                    objectQueue.queue.isEmpty()) {
                                _poolMap.remove(key);
                                _poolList.remove(key);
                            }
                        } else {
                            _totalInternalProcessing--;
                        }
                    }
                    allocate();
                }
            }

        }
    }