You can do this with VisualVM. First, install the VisualVM-MBeans plugin and restart VisualVM. After that, on the new MBeans tab, select java.lang.Memory.HeapMemoryUsage. The maximum value will give you the maximum allocated memory.
Update
, HeapMemoryUsage.max . , java.lang.MemoryPool. <Generation> .PeakUsage.used. , , , PeakUsage.max Eden Space Old Gen plus Survivor Space .
, :
. , JMX.
, "" VisualVM, "" "", .
, , , , , "" VisualVM. .