BAEL-835 code files
This commit is contained in:
parent
8a99c5e6f5
commit
36a3d11761
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.outofmemoryerror.java_outofmemoryerror_demo;
|
||||
|
||||
public class Test {
|
||||
public static void main( String[] args )
|
||||
{
|
||||
OutOfMemoryGCLimitExceed.putPropertiesToMap();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue