Scala: Fixing the pesky java.lang.OutOfMemoryError: PermGen space with SBT


When I started to use SBT, I continuously ran in to the pesky PermGen space error.

[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
[error] Use 'last' for the full log.

To solve the problem, I added the following environment variable to my bash profile:

export SBT_OPTS="-XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=512M"
Advertisements

3 Responses to Scala: Fixing the pesky java.lang.OutOfMemoryError: PermGen space with SBT

  1. Alexander Millar says:

    Thanks, saved me quite a headache!

  2. Nishit says:

    Thanks !…

  3. Mallikarjun says:

    I faced the same issue now after 2 years. But I did not understand why this happened suddenly on my mac. Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: