private void finishedMemoryProcessing(long beginTime) {
        long endTime = System.currentTimeMillis();
        long duration = endTime - beginTime;
        if (duration > 0)
            cumulativeDurationManagingMemory += duration;
        if (previousTimestampManagedMemory != 0) {
            duration = beginTime - previousTimestampManagedMemory;
            if (duration > 0)
                cumulativeDurationNotManagingMemory += duration;
        }
        previousTimestampManagedMemory = endTime;

        long totalDuration = cumulativeDurationManagingMemory + cumulativeDurationNotManagingMemory;
        if (totalDuration > 0) {
            percentageDurationManagingMemory =
                    (int) (cumulativeDurationManagingMemory * 100 / totalDuration);
        }
    }