Java随手记[1]: OutOfMemeory 分析 java heap space
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
at java.lang.StringBuilder.append(StringBuilder.java:136)
at java.lang.StringBuilder.append(StringBuilder.java:76)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:484)
at java.lang.StringBuilder.append(StringBuilder.java:166)
at java.lang.StringBuilder.append(StringBuilder.java:76)
at java.util.Formatter$FixedString.print(Formatter.java:2595)
at java.util.Formatter.format(Formatter.java:2508)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2940)
堆内存是存放java 对象的地方,每个被new 出来的对象都会存放在堆内存当中。