Interface MemoryMXBean

    • Method Detail

      • gc

        void gc()
        Requests the virtual machine to run the system garbage collector.
      • getHeapMemoryUsage

        MemoryUsage getHeapMemoryUsage()
        Returns the current memory usage of the heap for both live objects and for objects no longer in use which are awaiting garbage collection.
        Returns:
        an instance of MemoryUsage which can be interrogated by the caller.
      • getNonHeapMemoryUsage

        MemoryUsage getNonHeapMemoryUsage()
        Returns the current non-heap memory usage for the virtual machine.
        Returns:
        an instance of MemoryUsage which can be interrogated by the caller.
      • getObjectPendingFinalizationCount

        int getObjectPendingFinalizationCount()
        Returns the number of objects in the virtual machine that are awaiting finalization. The returned value should only be used as an approximate guide.
        Returns:
        the number of objects awaiting finalization.
      • isVerbose

        boolean isVerbose()
        Returns a boolean indication of whether or not the memory system is producing verbose output.
        Returns:
        true if verbose output is being produced ; false otherwise.
      • setVerbose

        void setVerbose​(boolean value)
        Updates the verbose output setting of the memory system.
        Parameters:
        value - true enables verbose output ; false disables verbose output.
        Throws:
        SecurityException - if a SecurityManager is being used and the caller does not have the ManagementPermission value of "control".
        See Also:
        ManagementPermission