반응형
Error
Intellij에서 SpringBoot 어플리케이션 실행 시 아래와 같은 에러가 발생함.
[ERROR][2024-09-02 17:05:00.881] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed: java.lang.OutOfMemoryError: Java heap space] with root cause
java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.Arrays.copyOfRange(Arrays.java:3822)
at java.base/java.lang.StringLatin1.newString(StringLatin1.java:769)
at java.base/java.lang.StringBuilder.toString(StringBuilder.java:453)
at org.apache.ibatis.executor.resultset.ResultSetWrapper.getMapKey(ResultSetWrapper.java:182)
at org.apache.ibatis.executor.resultset.ResultSetWrapper.getMappedColumnNames(ResultSetWrapper.java:164)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.createRowKeyForMappedProperties(DefaultResultSetHandler.java:1177)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.createRowKey(DefaultResultSetHandler.java:1141)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyNestedResultMappings(DefaultResultSetHandler.java:1064)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:449)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyNestedResultMappings(DefaultResultSetHandler.java:1070)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:449)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyNestedResultMappings(DefaultResultSetHandler.java:1070)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:436)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForNestedResultMap(DefaultResultSetHandler.java:1026)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:335)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:310)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:202)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:66)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:336)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:90)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:75)
at jdk.internal.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425)
[ERROR][2024-09-02 17:05:46.545] Error processing async timeouts
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.coyote.AbstractProtocol.startAsyncTimeout(AbstractProtocol.java:651)
at org.apache.coyote.AbstractProtocol.lambda$start$0(AbstractProtocol.java:637)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.iterator(ConcurrentHashMap.java:4635)
at org.apache.coyote.AbstractProtocol.lambda$startAsyncTimeout$1(AbstractProtocol.java:658)
at org.apache.coyote.AbstractProtocol$$Lambda$1724/0x0000000801623160.run(Unknown Source)
... 7 common frames omitted
반응형
Solution
아래와 같이 Intellij Memory Settings에서 Max Heap 값을 수정하면 된다 그래서 해봤는데.. 나의 경우는 결과는 동일했음..
Intellij Memory 수정
수정 확인
나의 경우에는 위 방법으로 해결되지 않았음.
위 방법은 아래 페이지에서 얘기하는 것 처럼 IntelliJ IDEA를 실행하는 Java Virtual Machine(JVM)은 미리 정의된 양의 메모리를 할당하는 방법인듯함.
https://www.jetbrains.com/help/idea/increasing-memory-heap.html
IDE에서 컴파일/빌드하는 앱의 heap 메모리와는 조금 다른 설정이라 아래와 같이 실행시 JVM 옵션을 추가하여 해결할 수 있었음..!
끝.
Thank you!
반응형
'IDE > intellij' 카테고리의 다른 글
[Intellij] Intellij에서 Terminal 실행시 에러 해결 (0) | 2024.05.13 |
---|---|
[Intellij] Intellij 실행 시 메인 화면 나오도록 설정하기 (0) | 2024.05.10 |
[Intellij] Intellij에서 gradle project dependency reload하기 (0) | 2024.05.08 |
[Intellij] Intellij 소스트리에서 추가한 jar preview 설정하는 방법 (0) | 2024.05.08 |
[Intellij] error: unmappable character (0xEC) for encoding x-windows-949 에러 해결 (0) | 2024.05.08 |