def delete(self):
     if __dev__:
         del self._sentExitServerEvent
     self._doPlayerExit()
     ClsendTracker.destroy(self)
     if __dev__:
         GarbageReport.checkForGarbageLeaks()
     DistributedAvatarAI.DistributedAvatarAI.delete(self)
Esempio n. 2
0
 def delete(self):
     if __dev__:
         del self._sentExitServerEvent
     self._doPlayerExit()
     ClsendTracker.destroy(self)
     if __dev__:
         GarbageReport.checkForGarbageLeaks()
     DistributedAvatarAI.DistributedAvatarAI.delete(self)
Esempio n. 3
0
 def delete(self):
     if __dev__:
         # make sure _sendExitServerEvent() was called
         assert self._sentExitServerEvent
         del self._sentExitServerEvent
     self._doPlayerExit()
     if __dev__:
         GarbageReport.checkForGarbageLeaks()
     DistributedAvatarAI.DistributedAvatarAI.delete(self)
Esempio n. 4
0
 def checkForGarbageLeaks(self, wantReply):
     senderId = self.air.getAvatarIdFromSender()
     self.notify.info("checking for garbage leaks requested by %s" %
                      senderId)
     # okay checking for garbage leaks should only be done by devs, it's rare enough i'll flag it
     # as suspicious
     self.air.writeServerEvent('suspicious', senderId,
                               'checkForGarbageLeaks')
     numLeaks = GarbageReport.checkForGarbageLeaks()
     if wantReply:
         requesterId = self.air.getAvatarIdFromSender()
         self.sendUpdateToAvatarId(requesterId, 'setNumAIGarbageLeaks',
                                   [numLeaks])
Esempio n. 5
0
 def _adjustGcThreshold(self, task):
     numGarbage = GarbageReport.checkForGarbageLeaks()
     if numGarbage == 0:
         self.gcNotify.debug('no garbage found, doubling gc threshold')
         a, b, c = gc.get_threshold()
         gc.set_threshold(min(a * 2, 1 << 30), b, c)
         task.delayTime = task.delayTime * 2
         retVal = Task.again
     else:
         self.gcNotify.warning('garbage found, reverting gc threshold')
         gc.set_threshold(*self._gcDefaultThreshold)
         retVal = Task.done
     return retVal
Esempio n. 6
0
 def _adjustGcThreshold(self, task):
     # do an unconditional collect to make sure gc.garbage has a chance to be
     # populated before we start increasing the auto-collect threshold
     # don't distribute the leak check from the client to the AI, they both
     # do these garbage checks independently over time
     numGarbage = GarbageReport.checkForGarbageLeaks()
     if numGarbage == 0:
         self.gcNotify.debug('no garbage found, doubling gc threshold')
         a, b, c = gc.get_threshold()
         gc.set_threshold(min(a * 2, 1 << 30), b, c)
         task.delayTime = task.delayTime * 2
         retVal = Task.again
     else:
         self.gcNotify.warning('garbage found, reverting gc threshold')
         # the process is producing garbage, stick to the default collection threshold
         gc.set_threshold(*self._gcDefaultThreshold)
         retVal = Task.done
     return retVal
Esempio n. 7
0
    def _adjustGcThreshold(self, task):
        # do an unconditional collect to make sure gc.garbage has a chance to be
        # populated before we start increasing the auto-collect threshold
        # don't distribute the leak check from the client to the AI, they both
        # do these garbage checks independently over time
        numGarbage = GarbageReport.checkForGarbageLeaks()
        if numGarbage == 0:
            self.gcNotify.debug('no garbage found, doubling gc threshold')
            a, b, c = gc.get_threshold()
            gc.set_threshold(min(a * 2, 1 << 30), b, c)

            task.delayTime = task.delayTime * 2
            retVal = Task.again

        else:
            self.gcNotify.warning('garbage found, reverting gc threshold')
            # the process is producing garbage, stick to the default collection threshold
            gc.set_threshold(*self._gcDefaultThreshold)
            retVal = Task.done

        return retVal
    def delete(self):
        self._doPlayerExit()
        if __dev__:
            GarbageReport.checkForGarbageLeaks()

        DistributedAvatarAI.DistributedAvatarAI.delete(self)