Minor modification BAEL-835
This commit is contained in:
parent
06d375bc42
commit
376a21bbbc
|
@ -1,14 +1,15 @@
|
|||
package com.baeldung.outofmemoryerror.java_outofmemoryerror_demo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class OutOfMemoryGCLimitExceed {
|
||||
public static void putPropertiesToMap() {
|
||||
Map<Object, Object> map = System.getProperties();
|
||||
public static void addRandomDataToMap() {
|
||||
Map<Integer, String> dataMap = new HashMap<Integer,String>();
|
||||
Random r = new Random();
|
||||
while (true) {
|
||||
map.put(r.nextInt(), "value");
|
||||
dataMap.put(r.nextInt(), String.valueOf(r.nextInt()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue