0

I have the following details of a Java process (WildFly application server):

 "heap-memory-usage" => {
            "init" => 536870912L,
            "used" => 73683328L,
            "committed" => 505413632L,
            "max" => 1908932608L
        }

I need to create an alert when the amount of free memory drops under a certain level. Is it correct to assume that the heap available memory equals to (max - used) ? or should I use (max - committed) ?
Thanks

user2824073
  • 2,407
  • 10
  • 39
  • 73

1 Answers1

1

You should use max - used. See java.lang.management.MemoryUsage class API for details

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275