MCPcopy Index your code
hub / github.com/apache/tomcat / formatMemoryUsage

Method formatMemoryUsage

java/org/apache/tomcat/util/Diagnostics.java:437–447  ·  view source on GitHub ↗

Format contents of a MemoryUsage object. @param name a text prefix used in formatting @param usage the MemoryUsage object to format @return the formatted contents

(String name, MemoryUsage usage)

Source from the content-addressed store, hash-verified

435 * @return the formatted contents
436 */
437 private static String formatMemoryUsage(String name, MemoryUsage usage) {
438 if (usage != null) {
439 StringBuilder sb = new StringBuilder();
440 sb.append(INDENT1).append(name).append(" init: ").append(usage.getInit()).append(CRLF);
441 sb.append(INDENT1).append(name).append(" used: ").append(usage.getUsed()).append(CRLF);
442 sb.append(INDENT1).append(name).append(" committed: ").append(usage.getCommitted()).append(CRLF);
443 sb.append(INDENT1).append(name).append(" max: ").append(usage.getMax()).append(CRLF);
444 return sb.toString();
445 }
446 return "";
447 }
448
449 /**
450 * Retrieves a formatted JVM information text. The default StringManager will be used.

Callers 1

getVMInfoMethod · 0.95

Calls 3

getMaxMethod · 0.80
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected