Failed to start thread - on Server start

Hi! In the last days I did my first steps with Keycloak. A interesting tool. I tried to install it on a virtual machine wich have brand new ubuntu installed. After download of keycloak package I tried to start server but get a lot of error messages. All I did before was to install java.
Here is my error message. Can anybody help me with this problem?

        15:52:49,677 INFO  [] (MSC service thread 1-2) WFLYSRV0049: Keycloak 11.0.1   (WildFly Core 12.0.3.Final) starting
[1,531s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
15:52:50,270 ERROR [] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: WFLYCTL0085: Failed to parse configuration
at java.base/
Caused by: java.util.concurrent.RejectedExecutionException
at org.jboss.threads@2.3.3.Final//org.jboss.threads.RejectingExecutor.execute(
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.rejectException(
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.doStartThread(
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.execute(
at java.base/java.util.concurrent.AbstractExecutorService.submit(
at org.jboss.staxmapper@1.3.0.Final//org.jboss.staxmapper.XMLMapperImpl.processNested(
at org.jboss.staxmapper@1.3.0.Final//org.jboss.staxmapper.XMLMapperImpl.parseDocument(
... 3 more
Suppressed: 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(
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.JBossThread.start(
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.doStartThread(
	... 13 more

15:52:50,302 FATAL [] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
[1,612s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.

-> java.lang.OutOfMemoryError, possibly out of memory or process/resource limits reached
Provide at least 1GB of memory

Thank you zonaut! How can I check available memory?
Edit: I checked available memory and all seems fine. Do I have to give java more memory available in anyway?

You created a virtual machine with what specs? Please be more detailed in describing the error and the environment where you run it on. Also is Keycloak the only thing you run on this virtual machine?

Sorry here more Information, hope this will help you. I get one from Provider. At the moment there is a clean Ubuntu 18.04 LTS 64bit running with 4core CPU, 4 GB memory and 200 GB Diskspace. All I did until yet is login as root, installed java, did a wget to get package, unzip and tried to start server with bash

Are you by any chance starting Keycloak over ssh? Try to start Keycloak through a systemd service.
It’s possible there are limits on the amount of processes you can start over ssh and this could cause this issue.

1 Like

I did all above with SSH Login :roll_eyes:.

Like I said, try creating a systemd service for Keycloak or do a search on ulimit for sshd on Google to try to override the limitation.