Pergunta

I get this error when deploying Play! app on dokku: Total 27 (delta 0), reused 0 (delta 0)

-----> Building test ...

Play 2.x - Java app detected

-----> Installing OpenJDK 1.6...done

-----> Building app with sbt

-----> Running: sbt clean compile stage

Error occurred during initialization of VM

Could not reserve enough space for object heap

! Failed to build app with sbt

To dokku@breams.pl:test

! [remote rejected] master -> master (pre-receive hook declined)

My server has 512MB of ram and it is VPS. When i use play run command everything is forking fine. Only during dokku deployment i get this error.

Can anyone help me overcome this issue?

Foi útil?

Solução

Ran into the same problem today on a Digital Ocean VPS with 512MB RAM. Since the droplet does not have swap space, I decided to added it, by running the following commands as root:

touch /var/swap.img
chmod 600 /var/swap.img
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab

It adds 1GB of swap space.

A second deployment didn't complain about the heap space anymore.

However, in my case, the SBT build failed later on during the deployment. Resizing the droplet to 1024MB did the trick and Dokku reports the application as being deployed.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top