Play! Framework on dokku memory issue (heap object)
Asked Answered
S

1

5

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 [email protected]: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?

Screwworm answered 7/2, 2014 at 11:56 Comment(0)
S
7

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.

Soonsooner answered 8/2, 2014 at 13:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.