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