import sys;
from java.util import Properties;
from java.io import File;
from java.io import FileOutputStream;

outPropsLocation = sys.argv[1];
props = Properties();


server = AdminConfig.getid('/Server:'+sys.argv[0]+'/')
jvm = AdminConfig.list('JavaVirtualMachine', server)



initialHeapSize = AdminConfig.showAttribute(jvm, 'initialHeapSize')
maximumHeapSize = AdminConfig.showAttribute(jvm, 'maximumHeapSize')

props.setProperty("maximumHeapSize", maximumHeapSize);
props.setProperty("initialHeapSize", initialHeapSize);

outPropsFile = File(outPropsLocation);
stream = FileOutputStream(outPropsFile);
props.store(stream, "JVM Settings");
