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