Minor modification BAEL-835

This commit is contained in:
buddhini81 2017-06-29 08:03:14 +05:30 committed by GitHub
parent 06d375bc42
commit 376a21bbbc
1 changed files with 4 additions and 3 deletions

View File

@ -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()));
}
}
}