code: public static long initialMemory() {
          long memory = 0;
          for (MemoryPoolMXBean mp : ManagementFactory.getMemoryPoolMXBeans()) {
              memory += mp.getUsage().getInit();
          }
          return memory;
      }
docs: Represents the initial amount of memory (in bytes) that the Java virtual machine requests from
  the operating system for memory management during startup.
  The Java virtual machine may request additional memory from the operating system and may also
  release memory to the system over time.
  The value of init may be undefined.
  
  @return memory