docker permission denied 문제

ubuntu에서 docker 연결시

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/auth": dial unix /var/run/docker.sock: connect: permission denied

이런 문제가 발생할 때

해결방법

sudo chmod 666 /var/run/docker.sock

로컬 db사용시 docker 이미지 빌드 안되는 문제

jdbc:mysql://host.docker.internal:3306/xxx?characterEncoding=UTF=8

맥북 m1 빌드 오류(호환성 문제)

[Docker]맥북 M1 빌드 오류(linux/arm64, linux/amd64)

배포 시 발생하는 Error

java.lang.OutOfMemoryError: Java heap space

2023-12-28T13:35:20.343Z ERROR 1 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : 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.io.ObjectInputStream$FieldValues.<init>(ObjectInputStream.java:2603) ~[na:na]
        at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2468) ~[na:na]
        at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2268) ~[na:na]
        at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1744) ~[na:na]
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:514) ~[na:na]
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:472) ~[na:na]
        at java.base/java.util.ArrayList.readObject(ArrayList.java:899) ~[na:na]
        at java.base/jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1231) ~[na:na]
        at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2434) ~[na:na]
        at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2268) ~[na:na]
        at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1744) ~[na:na]
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:514) ~[na:na]
        at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:472) ~[na:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:141) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:149) ~[aho-corasick-1.1.0.jar!/:na]
        at kr.co.shineware.ds.aho_corasick.model.AhoCorasickNode.load(AhoCorasickNode.java:130) ~[aho-corasick-1.1.0.jar!/:na]

로컬에서는 잘 돌아가던 놈이 배포를 하니까 OOM(OutOfMemory) 에러가 뜨는 문제가 발생했다

그래서 jvm힙 메모리 설정을 찾아보았다

ubuntu@ip-172-31-46-76:~$ java -XX:+PrintFlagsFinal -version 2>&1 | grep -i -E 'heapsize|permsize|version'
   size_t ErgoHeapSizeLimit                        = 0                                         {product} {default}
   size_t HeapSizePerGCThread                      = 43620760                                  {product} {default}
   size_t InitialHeapSize                          = 16777216                                  {product} {ergonomic}
   size_t LargePageHeapSizeThreshold               = 134217728                                 {product} {default}
   size_t MaxHeapSize                              = 251658240                                 {product} {ergonomic}
   size_t MinHeapSize                              = 8388608                                   {product} {ergonomic}
    uintx NonNMethodCodeHeapSize                   = 5826188                                {pd product} {ergonomic}
    uintx NonProfiledCodeHeapSize                  = 122916026                              {pd product} {ergonomic}
    uintx ProfiledCodeHeapSize                     = 122916026                              {pd product} {ergonomic}
   size_t SoftMaxHeapSize                          = 251658240                              {manageable} {ergonomic}