Mark phase of a mark-and-sweep garbage collector. It will mark all
 objects that are reachable from the root objects.
764771
def mark
      classes = Set.new
      marked_objects = 0
      @progressmeter.start("Marking linked objects", @db.item_counter) do
        each do |obj|
          classes.add(obj.class)
          @progressmeter.update(marked_objects += 1)
        end
      end
      @class_map.keep(classes.map { |c| c.to_s })

      # The root_objects object is included in the count, but we only want to
      # count user objects here.
      PEROBS.log.debug "#{marked_objects - 1} of #{@db.item_counter} " +
        "objects marked"
      @stats.marked_objects = marked_objects - 1
    end
1256695
protected final void requestCheckpoint(boolean persistent)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "requestCheckpoint",
                        new Object[] { new Boolean(persistent) });

        // During restart checkpointHelper is not running so don't request a checkpoint.
        // A checkpoint is forced at startup once it is safe to do so.
        if (checkpointHelper != null)
            checkpointHelper.requestCheckpoint(persistent);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "requestCheckpoint");
    }
970440
public void run()
	{
		while (true) {
			final long start = System.currentTimeMillis();
			long remaining;
			Cache c;
			synchronized (lock) {
				c = cache;
				remaining = sweepInterval * 1000;
				while (remaining > 0 && cache != null) {
					try {
						lock.wait(remaining);
					}
					catch (final InterruptedException e) {}
					remaining = start + sweepInterval * 1000 - System.currentTimeMillis();
				}
				if (cache == null)
					break;
			}
			c.removeExpired();
		}
	}
409971
def heapify(self, key=__marker):
        
        if key is self.__marker:
            n = len(self._heap)
            for pos in reversed(range(n//2)):
                self._sink(pos)
        else:
            try:
                pos = self._position[key]
            except KeyError:
                raise KeyError(key)
            self._reheapify(pos)
643130
def _mark_in_progress(self, node_id):
        
        self.queued.remove(node_id)
        self.in_progress.add(node_id)
287341
def push_mark(pos = @point)
      @mark = new_mark
      @mark.location = pos
      @mark_ring.push(@mark)
      if self != Buffer.minibuffer
        global_mark_ring = Buffer.global_mark_ring
        if global_mark_ring.empty? || global_mark_ring.current.buffer != self
          push_global_mark(pos)
        end
      end
    end
480311
public function mark()
    {
        if (!$this->markSupported()) {
            throw new IOException(get_class($this) . " does not support mark() and reset() methods.");
        }
        $this->mark = $this->currentPosition;
    }
411628
def mark(self):
        
        self.reliableListener.lastRun = extime.Time()
        BatchProcessingError(
            store=self.reliableListener.store,
            processor=self.reliableListener.processor,
            listener=self.reliableListener.listener,
            item=self.workUnit,
            error=self.failure.getErrorMessage())
610635
public void flush() {
        top = null;
        defaultEntry.reset(0);
        first.reset(minQueueLength);

        for (int i = memregs.length - 1; i > 0; i--) {
            MemReg mr = memregs[i];
            mr.in = mr.out = -1;
        }
        /*
        for (int i = memregs.length - 1; i > 0; i--) {
            MemReg mr = memregs[i];
            mr.in = mr.out = -1;
        }*/
        called = false;
    }
274017
public synchronized void markNotReady() 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "markNotReady");

    // No-op

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "markNotReady");
  }
471798
private void markSubroutines() {
        BitSet anyvisited = new BitSet();

        // First walk the main subroutine and find all those instructions which
        // can be reached without invoking any JSR at all
        markSubroutineWalk(mainSubroutine, 0, anyvisited);

        // Go through the head of each subroutine and find any nodes reachable
        // to that subroutine without following any JSR links.
        for (Iterator<Map.Entry<LabelNode, BitSet>> it = subroutineHeads
                .entrySet().iterator(); it.hasNext();) {
            Map.Entry<LabelNode, BitSet> entry = it.next();
            LabelNode lab = entry.getKey();
            BitSet sub = entry.getValue();
            int index = instructions.indexOf(lab);
            markSubroutineWalk(sub, index, anyvisited);
        }
    }
807513
def mark_data_dirty(self):
        
        self.__cache.set_cached_value_dirty(self.__display_item, self.__cache_property_name)
        self.__initialize_cache()
        self.__cached_value_dirty = True
23310
private void cascadeMarkedForInsert()
    {
        // This list was used to avoid endless recursion on circular references
        List alreadyPrepared = new ArrayList();
        for(int i = 0; i < markedForInsertList.size(); i++)
        {
            ObjectEnvelope mod = (ObjectEnvelope) markedForInsertList.get(i);
            // only if a new object was found we cascade to register the dependent objects
            if(mod.needsInsert())
            {
                cascadeInsertFor(mod, alreadyPrepared);
                alreadyPrepared.clear();
            }
        }
        markedForInsertList.clear();
    }
331722
def _sweep(self):
        
        while self.running:
            for am in list(self.activeMeasurements):
                now = datetime.datetime.utcnow()
                # devices were allocated and have completed == complete
                recordingDeviceCount = len(am.recordingDevices)
                if recordingDeviceCount > 0:
                    if all(entry['state'] == RecordStatus.COMPLETE.name for entry in am.recordingDevices.values()):
                        logger.info("Detected completedmeasurement " + am.id)
                        self._moveToComplete(am)

                # we have reached the end time and we have either all failed devices or no devices == kill
                if now > (am.endTime + datetime.timedelta(days=0, seconds=1)):
                    allFailed = all(entry['state'] == RecordStatus.FAILED.name
                                    for entry in am.recordingDevices.values())
                    if (recordingDeviceCount > 0 and allFailed) or recordingDeviceCount == 0:
                        logger.warning("Detected failed measurement " + am.id + " with " + str(recordingDeviceCount)
                                       + " devices, allFailed: " + str(allFailed))
                        self._moveToFailed(am)

                # we are well past the end time and we have failed devices or an ongoing recording == kill or deathbed
                if now > (am.endTime + datetime.timedelta(days=0, seconds=self.maxTimeTilDeathbedSeconds)):
                    if any(entry['state'] == RecordStatus.FAILED.name for entry in am.recordingDevices.values()):
                        logger.warning("Detected failed and incomplete measurement " + am.id + ", assumed dead")
                        self._moveToFailed(am)
                    elif all(entry['state'] == RecordStatus.RECORDING.name for entry in am.recordingDevices.values()):
                        self._handleDeathbed(am)
            time.sleep(0.1)
        logger.warning("MeasurementCaretaker is now shutdown")
233306
def track(cls, obj, ptr):
        
        cls._objects.add(cls(obj, ptr))
764396
private void stateCheckMark() {
        StackEntry e = stack[stk];
        int x = stateCheckPos(e.getStatePStr(), ((SCStackEntry)e).getStateCheck());
        stateCheckBuff[x / 8] |= (1 << (x % 8));
    }
792754
synchronized void captureCheckpointManagedObjects()
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "captureCheckpointManagedObjectsremove"
                            );

        // Now that we are synchronized check that we have not captured the checkpoint sets already. 
        if (checkpointManagedObjectsToWrite == null) {
            // Take the tokens to write first, if we miss a delete we will catch it next time. 
            // The managedObjectsToWrite and tokensToDelete sets are volatile so users of the store will move to them 
            // promptly.
            checkpointManagedObjectsToWrite = managedObjectsToWrite;
            managedObjectsToWrite = new ConcurrentHashMap(concurrency);
            checkpointTokensToDelete = tokensToDelete;
            tokensToDelete = new ConcurrentHashMap(concurrency);
        }

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "captureCheckpointManagedObjects");
    }