Bootstrap

java的readline耗内存吗_JAVA BufferedReader为啥大量占用内存

System.out.println("conductingnewuser_att...");try{bra=newBufferedReader(newFileReader(useratt));attline=bra.readLine();}catch(Exceptione){System.out.println("Opendata/us...

System.out.println("conducting new user_att...");

try{

bra = new BufferedReader(new FileReader(useratt));

attline = bra.readLine();

}catch(Exception e){

System.out.println("Open data/user_att1 error!");

System.out.println(e);

}

System.out.println("begin while...");

输出结果为

conducting new user_att...

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

at java.util.Arrays.copyOf(Arrays.java:2882)

at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)

at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515)

;