code: public static List<MemoryMonitor> getMemoryStats(){
          ArrayList<MemoryMonitor> memoryPoolInformation = new ArrayList<>();
          MemoryUsage heapMem = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
          memoryPoolInformation.add(new MemoryMonitor(HEAP_MEMORY,heapMem));
          MemoryUsage nonHeapMen = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
          memoryPoolInformation.add(new MemoryMonitor(NON_HEAP_MEMORY,nonHeapMen));
  
          for(MemoryPoolMXBean memMXBean :ManagementFactory.getMemoryPoolMXBeans()){
              memoryPoolInformation.add(new MemoryMonitor(memMXBean.getName(), memMXBean.getUsage()));
          }
          return Collections.unmodifiableList(memoryPoolInformation);
      }
docs: Query all register MemoryPools to get information and create a {@link MemoryMonitor} Pojo
  @return List with all the memory usage stats.