Answer the question
In order to leave comments, you need to log in
How to simulate a heap overflow in Java?
How to simulate a heap overflow in Java?
Answer the question
In order to leave comments, you need to log in
String[] arr = new String[Integer.MAX_VALUE];
String t = "aaaaa", b = "bbbbb";
for(int i = 0; i < Integer.MAX_VALUE; i++) {
arr[i] = t;
t += b;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question