forked from crossoverJie/JCSprout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b982403
commit dacd65b
Showing
3 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.crossoverjie.oom; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Function:堆内存溢出 | ||
* | ||
* @author crossoverJie | ||
* Date: 29/12/2017 18:22 | ||
* @since JDK 1.8 | ||
*/ | ||
public class HeapOOM { | ||
|
||
public static void main(String[] args) { | ||
List<String> list = new ArrayList<>(10) ; | ||
while (true){ | ||
list.add("1") ; | ||
} | ||
} | ||
} |