How to change IntelliJ memory usage properly on OsX

This is one of those quick posts with a small tip, this time the subject is how to change IntelliJ memory usage properly on OsX.

If you google a little bit looking for how to do that, you’ll probably find some zillions of posts saying that you should go to straight to /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions (don’t do this) and change it.

But even that it works, is kind of wrong, there’s a proper place “to place” your preferences, ~/Library/Preferences. This is what Apple say about this special folder:

The Preferences System

Preferences are application or system options that allow users to customise their working environment. Most applications read in some form of user preferences. For example, a document-based application may store preferences for the default font, automatic save options, or page setup information. Preferences are not limited to applications, however. You can read and write preference information, including user preferences, from any frameworks or libraries you define.

https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/UserPreferences.html

Why should we do this? Because this way you won’t mess up the original configurations and you’ll customise just for you without affecting any other user that maybe share the same Applications.

IntelliJ

Knowing about that, what you can do is just create the same file idea.vmoptions there, more specifically inside Idea’s folder, in my case:

~/Library/Preferences/IntelliJIdea2017.1/idea.vmoptions

You can place all your preferences into this file and IntelliJ will take whatever is here instead of the default one. Eg:

Now, next time that IntelliJ starts, it’ll take these configurations instead of the default ones without changing anything inside application’s original folders.

Leave a Reply