Intellij IDEA memory settings

From [elink link=”http://tomaszdziurko.pl/2015/11/1-and-the-only-one-to-customize-intellij-idea-memory-settings/”]

Give more memory to IDEA and it will perform better. No big surprise, but some recommendations based on 3 different approaches. I now use the ‘Balanced’, summarized below. More memory without starving everything else on the machine.

2GB for Xmx and 2GB for Xms, more balanced approach to the memory consumption

-Xms2g
-Xmx2g
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOops

For Mac, it’s in ~/Library/Preferences/IntellijIdea15/idea.vmoptions.
For Windows, it’s in Program Files (x86)/JetBrains/bin/idea.exe.vmoptions.

Update: Intellij provides a shortcut from the Help menu to customize the VM Options. It will open or create the file in the OS specific location. On the Help menu, choose ‘Edit Custom VM Settings’.

Finding Tomcat files when running inside Intellij IDEA

Investigating a problem, and created a custom logger using logback. Defined the file location as ${catalina.base}/logs/filename.log, but wasn’t sure where to find it.

Did a full drive search and discovered where Intellij stores it (at least on OSX).

To save myself future searches, it stores it in ~/Library/Caches/IntellijIdea15/tomcat folder where IntellijIdea15 will reflect the current version you’re running.

Within this directory will be folders for the various Tomcat Run Configurations. Inside the Run configurations folder will be the logs, webapps and conf folders.

More Intellij hints and tips

I’ve been using the 15 EAP, and now preview for awhile, and really appreciate the new features.

JetBrains has released another ‘Tips and Tricks’, which includes some of the new features in 15. If you’re an Intellij user, it’s well worth skimming through the list to see if you’re not using a feature you could be.

[elink link=”http://blog.jetbrains.com/idea/2015/10/intellij-idea-tips-and-tricks/”]

Intellij: Tips of the Day

I will periodically post hints and tips related to Intellij features. I’ve been using it now for almost 3 years, and am totally sold. Yes, it’s not free, but I think the price is well worth it.

Built-in Clipboard history. cmd-ctrl-V/ctrl-shift-V.

Default is 20, but like most things in Intellij, it’s customizable. Editor/General. Maximum number of contents to keep in clipboard:

Context management (Similar to Eclipse Mylyn).
Task Management plugin. One of the plugins that ships with Intellij.

Load, save and clear context (basically open tabs). Join Context with changesets in version history. Connect to Issue Tracker.

Git support. If you’re running 14.1+, the Git support is very good. Especially for the most common actions.

In addition, you can have it perform actions while doing a commit. Organize imports, format code, analyze code, notify of new TODOs etc.

I still prefer Eclipse’s approach to this with save actions (i.e. performed everytime a file is saved), rather than at the point I’m committing, but it does provide the functionality.

Intellij: Replace text while preserving case

How many times have you replaced text twice because the basic word was the same, but the starting letter in different cases was a difference case?

If you use Intellij, you don’t need to do that.

In the replace dialog is an option for ‘Preserve case’. Click it, and Intellij will do the right thing.

e.g. change This text to this text

Replace ‘this’ with ‘that’. Intellij will convert text to

change That text to that text.

Magic!