Class MemoryUsageMonitor


  • public class MemoryUsageMonitor
    extends Object
    • Field Detail

      • TEAMCITY_HIGH_MEMORY_USAGE_POOLS_NAMES_PROPKEY

        public static final String TEAMCITY_HIGH_MEMORY_USAGE_POOLS_NAMES_PROPKEY
        See Also:
        Constant Field Values
      • TOTAL_GC_THRESHOLD_EXCEEDED_ERROR_KEY

        public static final String TOTAL_GC_THRESHOLD_EXCEEDED_ERROR_KEY
        See Also:
        Constant Field Values
      • ourGetProcessCpuTime

        @Nullable
        protected static Method ourGetProcessCpuTime
      • ourGetSystemCpuLoad

        @Nullable
        protected static Method ourGetSystemCpuLoad
      • ourGarbageCollectionNotificationInfo_from

        protected static Method ourGarbageCollectionNotificationInfo_from
      • ourGarbageCollectionNotificationInfo_getGcAction

        protected static Method ourGarbageCollectionNotificationInfo_getGcAction
      • ourGarbageCollectionNotificationInfo_getGcInfo

        protected static Method ourGarbageCollectionNotificationInfo_getGcInfo
      • ourGarbageCollectionNotificationInfo_getGcCause

        protected static Method ourGarbageCollectionNotificationInfo_getGcCause
      • ourGcInfo_getMemoryUsageAfterGc

        protected static Method ourGcInfo_getMemoryUsageAfterGc
      • ourGcInfo_getMemoryUsageBeforeGc

        protected static Method ourGcInfo_getMemoryUsageBeforeGc
      • ourGcInfo_getGcDuration

        protected static Method ourGcInfo_getGcDuration
      • isGcEventListenerInitialized

        protected static boolean isGcEventListenerInitialized
    • Constructor Detail

      • MemoryUsageMonitor

        public MemoryUsageMonitor​(@NotNull
                                  TimeService timeService,
                                  @NotNull
                                  ServerMetrics serverMetrics)
    • Method Detail

      • startWatcher

        public void startWatcher()
      • stopWatcher

        public void stopWatcher()
      • getStatisticsCalculationTimeMinutes

        public int getStatisticsCalculationTimeMinutes()
      • getTrackedPoolNames

        public String[] getTrackedPoolNames()
      • isGcListenerInitialized

        public static boolean isGcListenerInitialized()
      • handleMemoryUsage

        protected void handleMemoryUsage​(String poolName,
                                         MemoryUsage usage,
                                         float averageUsage)
      • handleMemoryUsage

        protected void handleMemoryUsage​(String poolName,
                                         MemoryUsage usage,
                                         float averageUsage,
                                         boolean clearOnly)
      • handleTotalMemoryUsage

        protected void handleTotalMemoryUsage​(long maxAvailable,
                                              float averageMemoryUsagePercent,
                                              float averageGCUsage)
      • handleGCLoad

        protected void handleGCLoad​(long maxAvailable)
      • getTotalGcCount

        public long getTotalGcCount()
      • getTotalGcDuration

        public long getTotalGcDuration()
      • getLastGcDuration

        public long getLastGcDuration()
      • getLastGcTime

        public long getLastGcTime()
      • getLastGcEfficiency

        public long getLastGcEfficiency()
      • getGcLoadAverage

        public float getGcLoadAverage​(long since)
      • getGcEfficiencyAverage

        public long getGcEfficiencyAverage​(long since)
      • getGcDurationAverage

        public long getGcDurationAverage​(long since)
      • getGcCount

        public long getGcCount​(long since)