Skip to content

Instantly share code, notes, and snippets.

@AhianZhang
Created May 30, 2019 02:30
Show Gist options
  • Save AhianZhang/e8796a375aa14ae791f28c24cdbdbc4e to your computer and use it in GitHub Desktop.
Save AhianZhang/e8796a375aa14ae791f28c24cdbdbc4e to your computer and use it in GitHub Desktop.
heap oom demo
import java.util.ArrayList;
import java.util.List;
/**
* <p>ClassName: Test</p>
* <p>Description: Test 类</p>
* <p>Company:</p>
*
* @author ahianzhang
* @version 1.0
* @date 2019/5/30
*/
public class Test {
public static void main(String[] args) {
List list = new ArrayList();
list.add("a");
list.add("b");
list.add("c");
for (int i = 0; i < list.size(); i++) {
list.add(i,"d");
System.out.println(list);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment