I've set the options for a java process to use 80% of 1g max ram. But when I use 'ps -o vsz', I see it is using 3.5g (starting from 2.5g). This causes a lot of swap and thus freezing the device. Why is the discrepancy?
UPDATE: The options to the JVM are now: -Xmx256m -Xshare:off -XX:+UseSerialGC -XX:NativeMemoryTracking=summary -XX:MaxRAM=768m -XX:MaxRAMPercentage=60
. They don't seem to change anything. The process starts at 2.4g and grows to 3.5g
UPDATE 2:
openjdk version "14" 2020-03-16
OpenJDK Runtime Environment (build 14+36)
OpenJDK 64-Bit Server VM (build 14+36, mixed mode)