Last Updated: February 25, 2016
·
2.067K
· lvenegas

OpenBSD, Java and /etc/login.conf

After a long absence from OpenBSD I decided to give 5.4 a try. I installed Java and JRuby.

Whenever I was logged in as a regular user and ran this command:

jruby -J-Xms1024m -J-Xmx1024m -J-Xmn256m -S bundle exec rake -T

I would get this error:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

After many hours trying various things I came across a post that mentioned changing the file /etc/login.conf to increase the default limits in place.

As root I changed the line:

staff:\
           :datasize-cur=512M:\
           ...

To:

staff:\
           :datasize-cur=2048M:\
           ...

I logged out and logged back in as my regular account and it worked as expected.