java.lang.OutOfMemoryError: unable to create native thread

My app-search self-hosted console is throwing following error on the login page. I've no clue what exactly is going wrong (and what's the root cause of it). Yes, it does indicate that it could be out of memory OR running out of threads; but I've limited ES to use 4g of memory (out of 16 gb available).

Can someone help me fix this?

I'm using ES and App Search Ver. 7.6 (latest).

java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
	at java.base/java.lang.Thread.start0(Native Method)
	at java.base/java.lang.Thread.start(Thread.java:803)
	at java.base/java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:937)
	at java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1352)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
	at org.jruby.compiler.JITCompiler.buildThresholdReached(JITCompiler.java:219)
	at org.jruby.internal.runtime.AbstractIRMethod.tryJit(AbstractIRMethod.java:62)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:101)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:141)
	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:156)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:143)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.actionpack_minus_4_dot_2_dot_11_dot_1.lib.action_dispatch.middleware.static.invokeOther15:match?(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/static.rb:114)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.actionpack_minus_4_dot_2_dot_11_dot_1.lib.action_dispatch.middleware.static.RUBY$method$call$0(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/actionpack-4.2.11.1/lib/action_dispatch/middleware/static.rb:114)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:140)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.rack_minus_1_dot_6_dot_11.lib.rack.sendfile.invokeOther7:call(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/rack-1.6.11/lib/rack/sendfile.rb:113)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.rack_minus_1_dot_6_dot_11.lib.rack.sendfile.RUBY$method$call$0(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/rack-1.6.11/lib/rack/sendfile.rb:113)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:140)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.app.middleware.stats_middleware_dot_class.invokeOther3:call(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/app/middleware/stats_middleware.class:10)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.app.middleware.stats_middleware_dot_class.RUBY$method$call$0(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/app/middleware/stats_middleware.class:10)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:140)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.shared_togo.lib.shared_togo.external_host_middleware_dot_class.invokeOther3:call(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/shared_togo/lib/shared_togo/external_host_middleware.class:15)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.shared_togo.lib.shared_togo.external_host_middleware_dot_class.RUBY$method$call$0(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/shared_togo/lib/shared_togo/external_host_middleware.class:15)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:140)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.railties_minus_4_dot_2_dot_11_dot_1.lib.rails.engine.invokeOther9:call(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/railties-4.2.11.1/lib/rails/engine.rb:518)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.railties_minus_4_dot_2_dot_11_dot_1.lib.rails.engine.RUBY$method$call$0(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/railties-4.2.11.1/lib/rails/engine.rb:518)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.railties_minus_4_dot_2_dot_11_dot_1.lib.rails.engine.RUBY$method$call$0$__VARARGS__(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/railties-4.2.11.1/lib/rails/engine.rb)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:84)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)
	at org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1169)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.railties_minus_4_dot_2_dot_11_dot_1.lib.rails.application.invokeSuper4:call(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/railties-4.2.11.1/lib/rails/application.rb:165)
	at tmp.jetty_minus_142_dot_93_dot_219_dot_255_minus_3002_minus_app_minus_search_dot_war_minus___minus_any_minus_985191846023762874_dot_dir.webapp.WEB_minus_INF.gems.gems.railties_minus_4_dot_2_dot_11_dot_1.lib.rails.application.RUBY$method$call$0(/tmp/jetty-142.93.219.255-3002-app-search.war-_-any-985191846023762874.dir/webapp/WEB-INF/gems/gems/railties-4.2.11.1/lib/rails/application.rb:165)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:140)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
	at uri_3a_classloader_3a_.rack.handler.servlet.invokeOther4:call(uri:classloader:/rack/handler/servlet.rb:22)
	at uri_3a_classloader_3a_.rack.handler.servlet.RUBY$method$call$0(uri:classloader:/rack/handler/servlet.rb:22)
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:140)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
	at org.jruby.RubyClass.finvoke(RubyClass.java:798)
	at org.jruby.runtime.Helpers.invoke(Helpers.java:450)
	at org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:364)
	at org.jruby.javasupport.JavaEmbedUtils$1.callMethod(JavaEmbedUtils.java:117)
	at org.jruby.rack.DefaultRackApplication.call(DefaultRackApplication.java:64)
	at org.jruby.rack.AbstractRackDispatcher.process(AbstractRackDispatcher.java:33)
	at org.jruby.rack.AbstractFilter.doFilter(AbstractFilter.java:66)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlets.QoSFilter.doFilter(QoSFilter.java:200)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:159)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:497)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.base/java.lang.Thread.run(Thread.java:834)