Applet out of memory exception
Posted on 2006-04-14
[I'm currently only executing my applet via Eclipse - but will be shoving it into a webpage soon]
My applet reads a file into chunks (where 'is' is the FileInputStream):
byte  data = new byte  ;
int r = 0 ;
while ( ( r = is.read( data, 0, data.length ) ) > 0 )
out.write( data, 0, r ) ;
It then buffers the chunks to a server/PHP script, which then outputs the data to a file on the server.
For the larger files, I get an OutOfMemory exception when I try and upload them.
Firstly, where is the mem leak in my above technique??
Secondly, how can I extend the amount of available mem to my signed applet?