Maven final memory output

Can someone explain to me what the final memory means on maven output: -

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:17 min (Wall Clock)
[INFO] Finished at: 2017-07-03T17:34:54+05:30
[INFO] Final Memory: 596M/2016M
[INFO] ------------------------------------------------------------------------

Is this peak maven memory usage at runtime? If yes, then when I execute maven, as shown below: -

/usr/bin/time -l mvn clean package

it reports maximum resident set sizeas 3671834624 bytes.

Can someone also tell me why the two numbers are different from each other and how can I get peak memory usage to execute maven?

Environment: -

  • OS - MacOSX Sierra - 10.12.5 (16F73)
  • Maven - 3.5
+4
source share
1 answer

The final memory is calculated as follows:

r = Runtime.getRuntime()
getLogger().info( 
"Final Memory: " + ( r.totalMemory() - r.freeMemory() ) / MB + "M/" + r.totalMemory() / MB + "M" );  

, - , , - ( + )

+2

Source: https://habr.com/ru/post/1680635/


All Articles