java - String buffer - OutOfMemoryError -
i having string buffer variable holds input read file. cases getting input file in huge size. in cases getting outofmemoryerror.
here code:
stringbuffer response = new stringbuffer(""); bufferedreader in = new bufferedreader(isr); string inputline; while ((inputline = in.readline()) != null) response.append(inputline); in.close();
kindly me how resolve issue.
either read input in chunks, or change -xmx
parameter (maximum memory size) in jvm larger size.
Comments
Post a Comment