32 에 AtomicCounterTest에서 아래 그림처럼 카운트 횟수를 지정하는 totalCount를 Integer.MAX_VALUE로 하면 Out Of Memory가 뜨는 문제가 발생합니다.
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.concurrent.AbstractExecutorService.newTaskFor(AbstractExecutorService.java:98)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:122)
at com.thread.concurrency.AtomicCounterTest.여러_더하기_수행_Executor(AtomicCounterTest.java:37)
at java.base/java.lang.invoke.LambdaForm$DMH/0x000000a000288800.invokeVirtual(LambdaForm$DMH)
at java.base/java.lang.invoke.LambdaForm$MH/0x000000a000190800.invoke(LambdaForm$MH)
at java.base/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
To Reproduce
Steps to reproduce the behavior:
Go to src/test/java/com/thread/concurrency/AtomicCounterTest.java
totalCount를 Integer.MAX_VALUE로 변경
테스트 실행
See error
Expected behavior
A clear and concise description of what you expected to happen.
Describe the bug
32 에 AtomicCounterTest에서 아래 그림처럼 카운트 횟수를 지정하는
totalCount
를 Integer.MAX_VALUE로 하면 Out Of Memory가 뜨는 문제가 발생합니다.To Reproduce Steps to reproduce the behavior:
src/test/java/com/thread/concurrency/AtomicCounterTest.java
totalCount
를 Integer.MAX_VALUE로 변경Expected behavior A clear and concise description of what you expected to happen.
Originally posted by @haxr369 in https://github.com/spring-templates/spring-concurrency-thread/issues/32#issuecomment-2033561044