Gzip read() causing java heap error

I have a user who is having a java heap problem when running a scripted button that downloads a gz file off an FTP site and then unzips the file.

we have been using the screen for several years now, but the downloaded file has grown. the file is currently 124 MB and is a csv file that contains ~668,000 lines.

i have the client set to an initial memory of 512MB and a max memory of 1024MB. if i try changing the max to 2048 the client will not launch.

is there something i can do so the client does not run out of memory unzipping the file?

here is the snippet of code

	import java
	import org.python.core
	import gzip
	import java.lang.StringBuffer as SB
	
	gzipFile = gzip.open(filename)            #open read-binary file f with name fn
	contents = gzipFile.read() #THIS IS LINE 51
	gzipFile.close()
	
	print "file unzipped"

If you launch the client using a 64-bit version of Java you should be able to increase the memory to 2048. It won’t launch on a 32-bit Java since it has a max of 1024 MB of memory. Does it work if you use a 64-bit version of Java or do you get the same problem?

it works on my 64-bit version of java.

Well it seems there is a memory issue with Jython when using gzip. You can try putting this code before your script runs to see if it helps:from java.lang import System System.setProperty("python.options.internalTablesImpl","weak")Run it on a 32-bit Java and let me know.