How to reproduce Java OutOfMemoryError - GC overhead limit exceeded
问题 My approach was to create hundred thousand local collections and populate them with random strings, something like this: SecureRandom random = new SecureRandom(); for(int i = 0 ; i < 100000 ; i++){ HashMap<String, String> map = new HashMap<String, String>(); for(int j = 0 ; j < 30 ; j++){ map.put(new BigInteger(130, random).toString(32), new BigInteger(130, random).toString(32)); } } I have provided -XX:+UseGCOverheadLimit jvm parameter too, but can not get the error. Is there any easy and