code: public static long committedMemory() {
          long memory = 0;
          for (MemoryPoolMXBean mp : ManagementFactory.getMemoryPoolMXBeans()) {
              memory += mp.getUsage().getUsed();
          }
          return memory;
      }
docs: Represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.
  The amount of committed memory may change over time (increase or decrease).
  
  @return memory