Hacker News new | ask | show | jobs
by eventualhorizon 3827 days ago
How much heap are you allocating? I was seeing unusually poor performance while working with a large project until I bumped the heap up to 4-6g. It still takes a minute when I open the project but is pretty performant otherwise. Also, I've had to invalidate the cache a couple of times when idea was behaving strangely (over a 5 yr or so period)
1 comments

Good suggestion; I've cranked it up to 5 GB from the default (0.75, iirc) in case the problems were stemming from the garbage collector spinning. Haven't tried it out yet, but thanks :)
5GB could potentially have a detrimental impact as well, instead of there not being enough memory and causing the GC to have to run aggressively you may simply be causing the GC to pause longer when it runs due to a larger heap of dead objects (the default GC is really bad here, G1 is a lot better). Try starting with 1-2GB, increase past if really necessary (it's been more than enough for me, personally).
In practice it seems to be hovering at around 1-2 anyways. On a side note, I really hate that the JVM requires users to be aware of its heap tuning parameters :/
One of the reasons why Java is largely relegated as a server-side language, I feel. I write WPF apps on .Net and I never have to worry about what I need to set for my heap size because the frameworks garbage collector just works as I'd expect it to - do the same thing with JavaFX and I feel like tearing my hair out.