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)
| 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. |