Large arrays public static void main(String[] args) { int[] arr = new int[Integer.MAX_VALUE]; } 카운팅 정렬(Counting sort)를 실습해 보려고 이것 저것 배열을 만들어 보던 도중, 위의 코드를 실행하자 에러가 발생 했습니다. Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit 2,147,483,647 의 크기로 생성을 시도 했는데, Java Virtual Machine이 배열의 크기에 제한을 걸어 두었다며 에러가 던져졌습니다. 실제 openjdk 의 코드를 조금 살펴보니, VM마다 각기 다른 배열 크기 제한을..
Java) new int[Integer.MAX_VALUE]