Hacker News new | ask | show | jobs
by KronisLV 1905 days ago
> It is a memory hog

This is different from my experience, when working on Java projects with a few thousand source files and about 1 million SLoC.

  Eclipse - had some problems with the autocomplete being slow to open, IDE was overall unresponsive and used around 2 GB of RAM
  NetBeans - the cache folder filled up weirdly quickly (though that was NetBeans 8.2 not the new Apache NetBeans), but the IDE worked fine with around 1.5 GB of RAM usage
  JetBrains - project was slow to open (+while indexing), but the IDE performs okay with 0.5 - 1 GB of RAM usage (though more needed when running/debugging)
Currently i have a computer with 24 GB of RAM and an 8 core CPU, both of those seem sufficient but in my experience the IDE isn't the main thing consuming memory, it's actually all the services you might want to launch through it (if you need breakpoints across multiple ones).

Of course, this would become more of an issue if you have something like 4 or 8 GB of RAM available.

Disclaimer: this is anecdotal data and i may be wrong in regards to latest versions of the IDEs, since i only use JetBrains products nowadays.

2 comments

> JetBrains - project was slow to open (+while indexing), but the IDE performs okay with 0.5 - 1 GB of RAM usage (though more needed when running/debugging)

Just to be specific: Is this your experience just running the IDE at default settings, or did you increase the JVM heap size for it and had no effect? If you run it at default settings, the memory footprint will stay <1GB, because that's all it's allowed to use.

My experience on this is that it's a great idea to bump the memory size to 4GB. I have not done any benchmarks on it, but it feels much faster in regular use.

I bumped the limit up to 2 GB, which is where i've left it for IntelliJ IDEA.

When the IDE is mostly idle (with 10-20 opened source files), it generally uses around 0.5 GB of RAM.

When i'm writing code, using autocomplete, reading documentation, running Maven actions, using the suggestions functionality (basically IntelliSense + some plugins), using refactoring functionality etc., then the memory usage can be bumped up to 1 GB.

When the code is running, the memory usage can get closer to the 2 GB limit, when using debugger functionality, recompiling classes on the fly and so on.

Personally, i haven't bumped the limit up higher, because i still need the memory for the actual Java processes of the services that i launch, since under normal circumstances i need at least 16 GB of RAM for all of the services to even run properly (but that may as well be a project related issue, since scheduled processes and a number of other optional things run locally, nor are all of them configured with Xmx and other parameters), though that's less relevant to the actual IDE performance (since i have swap turned off and it doesn't have an impact).

It's also terrible to overdo it. Had a coworker having issues with 4GB on a project and he bumped it to 16GB (on a 32GB MBP) which resulted in epicly long GC pauses.
If you know anything about java you'd know that it has max heap settings that are a command line option. Pretty much all java command line options, GC ergonomics incl are there. I have been using eclipse with an increased heap (and over tuned) since 2006 - modify eclipse.ini
This would matter if one of them had the limit that's much smaller than the others, which would lead to aggressive GC, which wasn't the case.

When working on the same project of a known size and using similar IDE functionality, different IDEs still had noticeably different performance characteristics (i implore you to try the same, especially with the same Xms and Xmx values set).

That simply leads me to believe that each IDE implements things differently, for example:

  - JetBrains have separate IDEs for separate languages (IntelliJ IDEA for Java, Rider for .NET, PhpStorm for PHP etc.)
  - NetBeans allows lazily loading support for different languages/frameworks/tools
  - Eclipse is generally viewed as a bunch of interconnected libraries/frameworks (JDT for Java, PDT for PHP etc.)
That's just one example of the architectural differences (which may impact which functionality is loaded when and how efficiently the memory is used), though it stands to reason that it's perfectly normal to observe them to act differently from one another, even in controlled circumstances, like the above.