You can use the sys.getsizeof() function to determine the size of an object in bytes.
The -Xms and -Xmx options are used to set the initial and maximum heap sizes, respectively, for the Java Virtual Machine (JVM).