BAEL-835 code files

This commit is contained in:
buddhini81 2017-06-20 06:51:43 +05:30 committed by GitHub
parent 8a99c5e6f5
commit 36a3d11761
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package com.baeldung.outofmemoryerror.java_outofmemoryerror_demo;
import java.util.Map;
import java.util.Random;
public class OutOfMemoryGCLimitExceed {
public static void putPropertiesToMap() {
Map<Object, Object> map = System.getProperties();
Random r = new Random();
while (true) {
map.put(r.nextInt(), "value");
}
}
}

View File

@ -0,0 +1,8 @@
package com.baeldung.outofmemoryerror.java_outofmemoryerror_demo;
public class Test {
public static void main( String[] args )
{
OutOfMemoryGCLimitExceed.putPropertiesToMap();
}
}