释放资源，一般不需要调用 | Frees resources, and generally does not need to call
554845
public void release() {
        HMSAgentLog.d("release");
        if (application != null) {
            application.unregisterActivityLifecycleCallbacks(this);
        }

        clearCurActivities();
        clearActivitResumeCallbacks();
        clearActivitPauseCallbacks();
        application = null;
    }
1336538
public boolean free(T value)
  {
    if (_freeRing.free(value))
      return true;
    else
      return _freeRingSoft.free(value);
  }
997402
public void free()
    {
        if (m_messageStackOwner != null)    // Always
            m_messageStackOwner.setMessageStack(null);
        m_messageStackOwner = null;
        if (m_bWaiting)
        {
            synchronized (m_thread)
            {
                if (m_bWaiting) // Inside the sync block
                    m_stack.removeAllElements();
                m_bWaiting = false;
                if (m_thread != null)
                {
                    m_stack = null;
                    m_thread.interrupt();
                }
                m_thread = null;
            }
        }
        m_stack = null;
        m_thread = null;
    }
281251
public void free()
    {
        if (m_record != null) // First, release the record for this table
        { // Do not free this.getFieldList() (may be current record)
            m_record.setTable(null);    // Don't try to free me
            m_record.free();
            m_record = null;
        }
    }
383206
public void addFreeConnection(ThriftConnectionHandle<T> thriftConnectionHandle)
			throws ThriftConnectionPoolException {
		thriftConnectionHandle.setOriginatingPartition(this);
		// 更新创建的连接数 创建数 +1
		updateCreatedConnections(1);

		if (!this.freeConnections.offer(thriftConnectionHandle)) {
			// 将连接放入队列失败 创建数 - 1
			updateCreatedConnections(-1);

			// 关闭原始连接
			thriftConnectionHandle.internalClose();
		}
	}
822577
def free(self):
        """"""
        if self._ptr is None:
            return
        Gauged.array_free(self.ptr)
        FloatArray.ALLOCATIONS -= 1
        self._ptr = None
1007558
def free(self):
        
        LOGGER.debug('Connection %s freeing', self.id)
        if self.handle.isexecuting():
            raise ConnectionBusyError(self)
        with self._lock:
            self.used_by = None
        LOGGER.debug('Connection %s freed', self.id)
948660
public void free()
    {
        BaseMessageManager messageManager = null;
        if (this.getTask() != null) // May have been freed already.
            if (this.getTask().getApplication() != null)
                messageManager = (BaseMessageManager)((Application)this.getTask().getApplication()).getMessageManager(false);
        if (messageManager != null)
            messageManager.freeFiltersWithListener(this);
        if (m_messageStack != null)
            m_messageStack.free();
        m_messageStack = null;
        super.free();
    }
753051
public void free()
    {
        m_recMerge = null;
        m_iFieldSeq = -1;
        m_iSecondaryFieldSeq = -1;
        this.fieldName = null;
        this.secondaryFieldName = null;
        super.free();
    }
1109851
@Override
    public void free(AllocationPoint point, AllocationStatus target) {
        //if (point.getAllocationStatus() == AllocationStatus.DEVICE)
        //deviceAllocations.get(point.getDeviceId()).remove(point.getObjectId());

        //zeroAllocations.get(point.getBucketId()).remove(point.getObjectId());
        if (point.getAllocationStatus() == AllocationStatus.DEVICE)
            deviceMemoryTracker.subFromAllocation(Thread.currentThread().getId(), point.getDeviceId(),
                            AllocationUtils.getRequiredMemory(point.getShape()));

        memoryProvider.free(point);
    }
230236
public void free()
    {
        try   {
            if (m_tableRemote != null)
                m_tableRemote.freeRemoteSession();
        } catch (RemoteException ex) {
            ex.printStackTrace();
        }
        m_tableRemote = null;
        super.free();
    }
1077694
public void free()
    {
        this.stopThisThread();      // This needs to be called first (even though super.free() calls it).
        super.free();               // Free all the filters next (This is also tell the remotesessions to clean up).
        if (m_receiveQueue != null)
        {
            try {
                m_receiveQueue.freeRemoteSession();
            } catch (RemoteException ex)    {
                ex.printStackTrace();
            }
        }
        m_receiveQueue = null;
    }
172577
public static void freeDirectNoCleaner(ByteBuffer buffer) {
        assert USE_DIRECT_BUFFER_NO_CLEANER;

        int capacity = buffer.capacity();
        PlatformDependent0.freeMemory(PlatformDependent0.directBufferAddress(buffer));
        decrementMemoryCounter(capacity);
    }
385821
def free(self, request_key):
        
        state = self.get(request_key)
        if not state:
            return
        state.forwardedTo -= 1
        self._clean(state)
1162235
public void free()
    {
        if (m_bKeepAlive)
        {
            m_bKeepAlive = false; // Don't stay alive
            m_bThreadSuspended = false;   // Unsuspend this puppy
            try {
                this.notify();          // If you're waiting, continue (and the thread will die)
            } catch (IllegalMonitorStateException ex) {
                // Ignore
            }
        }
        super.free();
    }
1089591
private boolean needToReclaimConnections() {
        boolean removemcw = false;
        for (int j = 0; j < maxFreePoolHashSize; ++j) {
            synchronized (freePool[j].freeConnectionLockObject) {
                int localtotalConnectionCount = totalConnectionCount.get();
                int mcwlSize = freePool[j].mcWrapperList.size();
                for (int k = 0; k < mcwlSize; ++k) {
                    MCWrapper mcw = (MCWrapper) freePool[j].mcWrapperList.get(k);
                    if (agedTimeout != -1) {
                        if (mcw.hasAgedTimedOut(agedTimeoutMillis)) {
                            removemcw = true;
                            break;
                        }
                    }
                    if (!removemcw && unusedTimeout != -1) {
                        if (mcw.hasIdleTimedOut(unusedTimeout * 1000)
                            && (localtotalConnectionCount > minConnections)) {
                            removemcw = true;
                            break;
                        }
                    }
                }
            }
            if (removemcw) {
                break;
            }
        }
        return removemcw;
    }
310781
def free(self, connection):
        
        LOGGER.debug('Pool %s freeing connection %s', self.id, id(connection))
        try:
            self.connection_handle(connection).free()
        except KeyError:
            raise ConnectionNotFoundError(self.id, id(connection))

        if self.idle_connections == list(self.connections.values()):
            with self._lock:
                self.idle_start = self.time_method()
        LOGGER.debug('Pool %s freed connection %s', self.id, id(connection))