The reason why Java reserves 1G for Classes hides in the way how it manages compressed class pointers.
The long answer: read this doc https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/considerations.html
The short answer: setup the correct size in ‘CompressedClassSpaceSize’ property -XX:CompressedClassSpaceSize=300m