Use configured maximum memory to determine limits
Use of Runtime.totalMemory() leads to different behavior as memory grows,
meaning we will perform different snapshots based on initial memory sizing
as well as the memory pressures from other parts of the system (which mean
the total memory will grow differently).
Use Runtime.maxMemory() instead, which will cause snapshotting to work
consistently with a fully-used system.
Change-Id: If6e4a135dc0b9a9d4795d1e5d75f7cbc60550c0d
Signed-off-by: Robert Varga <rovarga@cisco.com>