Java Memory logMemoryStats(String msg)

Here you can find the source of logMemoryStats(String msg)

Description

Log statistics on memory to stderr.

License

Apache License

Parameter

Parameter Description
msg Text to include in log.

Declaration

public static void logMemoryStats(String msg) 

Method Source Code

//package com.java2s;
// Licensed to the Apache Software Foundation (ASF) under one or more contributor

public class Main {
    /** Log statistics on memory to stderr.
     */*from  w  w  w  . j a  v  a 2 s.  c o  m*/
     * @param msg Text to include in log.
     */
    public static void logMemoryStats(String msg) {
        Runtime rt = Runtime.getRuntime();
        System.err.println(msg + ": total=" + (rt.totalMemory() / 1024)
                + "KB, free=" + (rt.freeMemory() / 1024) + "KB");
    }
}

Related

  1. isDefaultMemoryCardDrive(String aRoot)
  2. isInMemoryDatabase(final String databasePath)
  3. isMemoryAccess(final String value)
  4. isMemoryData(String metric)
  5. isMemorySufficient()
  6. makeVmMemoryDivisibleBy4(long memory)
  7. measureMemoryBefore()
  8. memory()
  9. memory()