When I was testing this download feature, if the audio files are more or the size of a individual audio is bigger, I got an exception: java.lang.OutOfMemoryError: Java heap space
How to fix this?
Any help is greatly appreciated!
Joined: Aug 15, 2004
How about writing the zip file to the disk temporarily and then throw that to the user.
Or you can avoid this by increasing your heap space.
I would prefer the former one.
Joined: Jan 13, 2004
Thank you for your reply.
Actually I was improperly using a memory stream -- ByteArrayOutputStream as the actual stream for the ZipOutputStream, thus all the files will write to memory, for sure causing out-of-memory exception is just a matter of time.