Druid excute task happen"java.lang.OutOfMemoryError: unable to create new native thread"

2020-05-12T08:00:37,442 INFO [task-runner-0-priority-0] io.druid.server.coordination.CuratorDataSegmentServerAnnouncer - Announcing self[DruidServerMetadata{name=‘mos1-miui-ad-druid03.ksru:8104’, hostAndPort=‘mos1-miui-ad-druid03.ksru:8104’, hostAndTlsPort=‘null’, maxSize=0, tier=’_default_tier’, type=realtime, priority=0}] at [/druid/miuiad/production/prod/announcements/mos1-miui-ad-druid03.ksru:8104]

6.971: [GC pause (G1 Evacuation Pause) (young), 0.0344714 secs]

[Parallel Time: 21.2 ms, GC Workers: 8]

[GC Worker Start (ms): Min: 6971.2, Avg: 6974.6, Max: 6979.0, Diff: 7.8]

[Ext Root Scanning (ms): Min: 0.0, Avg: 0.9, Max: 4.0, Diff: 4.0, Sum: 7.5]

[Update RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]

[Processed Buffers: Min: 0, Avg: 0.0, Max: 0, Diff: 0, Sum: 0]

[Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]

[Code Root Scanning (ms): Min: 0.0, Avg: 1.3, Max: 6.2, Diff: 6.2, Sum: 10.2]

[Object Copy (ms): Min: 9.7, Avg: 13.8, Max: 15.9, Diff: 6.2, Sum: 110.1]

[Termination (ms): Min: 0.1, Avg: 1.6, Max: 1.9, Diff: 1.8, Sum: 13.0]

[Termination Attempts: Min: 2, Avg: 99.8, Max: 135, Diff: 133, Sum: 798]

[GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]

[GC Worker Total (ms): Min: 13.3, Avg: 17.6, Max: 21.1, Diff: 7.8, Sum: 141.1]

[GC Worker End (ms): Min: 6992.3, Avg: 6992.3, Max: 6992.3, Diff: 0.0]

[Code Root Fixup: 0.3 ms]

[Code Root Purge: 0.0 ms]

[Clear CT: 0.3 ms]

[Other: 12.6 ms]

[Choose CSet: 0.0 ms]

[Ref Proc: 11.8 ms]

[Ref Enq: 0.1 ms]

[Redirty Cards: 0.2 ms]

[Humongous Register: 0.0 ms]

[Humongous Reclaim: 0.0 ms]

[Free CSet: 0.3 ms]

[Eden: 268.0M(268.0M)->0.0B(428.0M) Survivors: 24.0M->40.0M Heap: 291.2M(2048.0M)->37.9M(2048.0M)]

[Times: user=0.12 sys=0.02, real=0.03 secs]

2020-05-12T08:00:37,521 INFO [task-runner-0-priority-0] io.druid.curator.discovery.CuratorDruidNodeAnnouncer - Announcing [DiscoveryDruidNode{druidNode=DruidNode{serviceName=‘druid/miuiad/production/prod/middlemanager’, host=‘mos1-miui-ad-druid03.ksru’, port=-1, plaintextPort=8104, enablePlaintextPort=true, tlsPort=-1, enableTlsPort=false}, nodeType=‘peon’, services={dataNodeService=DataNodeService{tier=’_default_tier’, maxSize=0, type=realtime, priority=0}, lookupNodeService=LookupNodeService{lookupTier=’__default’}}}].

2020-05-12T08:00:37,536 INFO [main] org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@52c964e{HTTP/1.1,[http/1.1]}{0.0.0.0:8104}

2020-05-12T08:00:37,537 ERROR [main] io.druid.cli.CliPeon - Error when starting up. Failing.

java.lang.OutOfMemoryError: unable to create new native thread

at java.lang.Thread.start0(Native Method) ~[?:1.8.0_202]

at java.lang.Thread.start(Thread.java:717) ~[?:1.8.0_202]

at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957) ~[?:1.8.0_202]

at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1603) ~[?:1.8.0_202]

at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:334) ~[?:1.8.0_202]

at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533) ~[?:1.8.0_202]

at org.eclipse.jetty.util.thread.ScheduledExecutorScheduler.schedule(ScheduledExecutorScheduler.java:111) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.session.HashSessionManager.setScavengePeriod(HashSessionManager.java:326) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.session.HashSessionManager.doStart(HashSessionManager.java:155) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:120) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:116) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:120) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:809) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:345) ~[jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) ~[jetty-servlet-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:253) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.Server.start(Server.java:422) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.server.Server.doStart(Server.java:389) ~[jetty-server-9.3.19.v20170502.jar:9.3.19.v20170502]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.3.19.v20170502.jar:9.3.19.v20170502]

at io.druid.server.initialization.jetty.JettyServerModule$1.start(JettyServerModule.java:315) ~[druid-server-0.12.0.jar:0.12.0]

at io.druid.java.util.common.lifecycle.Lifecycle.start(Lifecycle.java:311) ~[java-util-0.12.0.jar:0.12.0]

at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:134) ~[druid-api-0.12.0.jar:0.12.0]

at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:101) [druid-services-0.12.0.jar:0.12.0]

at io.druid.cli.CliPeon.run(CliPeon.java:301) [druid-services-0.12.0.jar:0.12.0]

at io.druid.cli.Main.main(Main.java:116) [druid-services-0.12.0.jar:0.12.0]

Heap

garbage-first heap total 2097152K, used 59329K [0x00000003c0000000, 0x00000003c0401000, 0x00000007c0000000)

region size 4096K, 16 young (65536K), 10 survivors (40960K)

Metaspace used 48401K, capacity 49252K, committed 49484K, reserved 1093632K

class space used 5981K, capacity 6252K, committed 6272K, reserved 1048576K

Pls give me some suggestion

Can you try increasing the heap memory for your peon task?