memory leak

Answered

Idea 4.5 has a memory leak. After working for a couple of hours (if I'm lucky), it builds up its memory usage and eventually just keeps on doing garbage collection every 20 seconds or so until I restart it.
No matter what I do (I even close the project!!) it still stays on about 180mb (currently my max is 250mb)

This is VERY annoying, was this fixed in 5.x?

18 comments
Comment actions Permalink

No, it still does it in 5.1. I have some settings in my IDEA startup options that help somewhat but multiple times a day I have to wait 1-2+ minutes waiting for it to garabage collect. Eclipse doesn't have this issue so I fail to see why IDEA can't fix this.

For all the time I save using the spectacular features that IntelliJ offers I lose waiting for IntelliJ to garbage collect multiple times a day for minutes at a time.

I can't even articulate how annoying it is.

If Eclipse had a VI emulator as good as the plugin available for IntelliJ I would probably switch.

IMHO, software that costs $500 per user shouldn't just fail to respond for minutes at a time multiple times a day.

0
Comment actions Permalink

This has been complained about for years - memory utilization isn't high on the list, apparently. I have to restart Idea several times a day to clean up memory - open up a couple of different projects in different windows and throw CVS into the picture - I'll eat up a quarter of a gig in about 15 minutes - and Idea holds onto it for dear life. You're right - closing the project has no impact - once Idea has the memory it never lets go. One thing that has helped, though unfortunate, is turning off as much background processing as I can - ie, virtually all inspections - makes Idea responsive again - they're probably OK for lots of small files but if you have some really large source files, the inspections that take place when the file is opened or switched to absolutely kill me - I literally can go and get a cup of coffee while I wait for Idea to catch up with me. In fact, several of my coworkers have already ditched Idea - some for Eclipse, others for NetBeans - none of us prefer them but we all see superior responsiveness with both of these products.

What would make life much better for me is a better implementation of the inspections - having that much going on in the background in java is, IMHO, pushing the platform beyond it's capability based on the hardware - at least for very large projects. Unlike many out here, I don't have the choice of hardware, nor can I use my own at work. I have a relatively new DELL Inspiron laptop with a Gig of ram - Idea is by far the biggest pig on my machine. I'd much prefer Idea give me the ability to set up profiles of inspections I'm interested in but allow me turn off ALL background processing (other than the normal caching and source indexing it does). Then, WHEN I CHOOSE, let me run a code inspection - in other words, get back to the original idea of Idea - work the way I want to - don't force your ideas down my throat. So, take a look at the inspections you're using - turn as many off as you can. Obviously, you should also check out your jvm settings - you might get some performance improvements with GC startup options - and obviously make sure you're allocating enough memory initially and allow some growth.

I figure the next release of the product will be the big one for me - if it isn't substantially better with memory management and performance, it'll be time to bite the bullet and move off the product. I still think the interface is better, by far, than anything else out there. But, bottom line, I have work to do and I simply can't be sitting around waiting on my IDE - my IDE is supposed be waiting around on me!

0
Comment actions Permalink

I guess we the developer have to understand that intellij is a very complex programming system, and as such it bound to have memory leak or have
issue. In fact, that the price to pay for having such powerful editor.

Only with powerful cpu, and lot of ram can we harness the power of that editor.
Just look at Windows Vista. Not only it is wonderful in features, it is wonderful even
in its hardware requirement. Talking about price to pay <:^} ..
There no such thing as free lunch in the world.

Software system can only get more and more complex and more memory hungry.

0
Comment actions Permalink

Well, I don't buy that as an absolute. I've been working for software companies for over 20 years and I have yet to find a customer who would accept "yeah, it's a bug, and a bad one because it affects your user experience every day, but you'll just have to live with it". The general response to that is "Well, no, we'll go evaluate alternatives". Of course we accept that there will be bugs - but we also expect them to be fixed - well, at least my customers do - maybe yours are more understanding. Obviously I prefer Idea over Eclipse and NetBeans - but, these products are not dramatically inferior - in fact, they're both quite powerful and getting better all the time - and Eclipse, for all it's shortcomings, is FAR more extensible than anything out there - in terms of high quality professional plug-ins - and NetBeans isn't far off - all due respect, Idea's pretty much at the back of the pack in that department. As I say, I can run both of them on the exact same project I use with Idea and I don't have anywhere NEAR the lags and memory issues I have with Idea. And I don't agree with your analogy - I think comparing an OS to an app is a stretch - example, I can run the latest MS Office on a 5 year old machine no problem. The biggest issue for me is the background processing, in particular, the inspections. Don't get me wrong - I love them - they add tremendous value - but, the implementation is all or nothing. That is, I turn the ones I want on and they WILL run in the background - let me tell you what, get hit by those on a couple of very large files in a large project and you'll get pretty pissed off. Besides, maybe many prefer to be constantly updated every time they type a character. My take is "guys, I know there are problems with my code - I haven't finished freakin' typing it yet!" You know, you haven't typed that closing } in the right time and the rest of the file is just one big error - now try typing - you hit a character then sit back and wait for it to appear in your file - incredibly annoying, not to mention a drain on productivity. The product is supposed to work the way I do - at least that used to be the mantra. Well, let me set up the inspections i want, turn OFF the background processing, and then give me a simple menu item that let's me manually instruct Idea to run the file through inspections. That, for me anyway, would offer up a HUGE performance boost and also let me work the way I want. For those who want them on in the background, fine - just understand that depending on file/project size and hardware there could be a performance hit. Maybe I'd agree with your take if I had ever seen any significant responses to these complaints explaining why the memory utilization and lags are so bad - but I never have - so i don't simply accept that this is complex feature execution - it could also be poor memory management. You're right, software gets more complex - which is why memory management and performance tuning are so critical - I have to deal with these issues every single day. In fact, once we determine that we don't have known feature bugs in new developement - the very next issue is performance - always! And if we're dealing with poor or overly aggressive memory management, throwing more at memory at the problem doesn't necessaryily help you out at all - it just takes a little longer for the product to eat that, then you're still hosed. There's no way my management is going to spring for a new machine because my IDE can't cut it anymore when others (which, BTW, are FREE) work just fine. Obviously, paying for Idea isn't my issue, if it was I wouldn't be using it - and I do pay for it out of my own pocket. But as such, I don't just accept poor performance, anymore than my customers would accept poor performance from me. And no, lunch isn't free, but when your favorite restaurant starts handing you bumb tuna then tells you the good stuff is available at a more expensive seat, well, you find a new favorite restaurant. I'm really not trying to trash the product, though it may sound it. I genuinely love the interface - for me, it's far superior and easier to work with than anything else and, at the price, I still consider it a steal over Eclipse and NetBeans. The best possible thing that could happen, for me anyway, is for Jetbrains to address some of these issues. But the bottom line is I work on very large projects - I have a job to do and my dealines are tight - no way I can blame an IDE on my failure to deliver. I figure the next release is it - if it's better, I'm very happy - if not, it's got to go.

0
Comment actions Permalink

Scott, I completely agree with your reasons. Let me assure you that we will do all we can to fix all the bugs our users submit. However the chances to fix are propotional to the clarity and descriptiveness of the bug posted. For example we would never be able to fix a bug stated as "there are memory leaks in IDEA". It is just the same as saying there are bugs. So if possible please submit a bug with a memory snapshot attached or steps to reproduce described.

0
Comment actions Permalink

Quite coincidentally I just submitted a memory leak bug with snapshot and steps to reproduce yesterday: http://www.jetbrains.net/jira/browse/IDEA-7966

Bas

0
Comment actions Permalink

The only thing is that Intellij can be fixed of memory leak. Though after been developer for many years, a complex system that has bug fix tend to introduce new bugs. But then, Intellij developer are a different breed apart. Just hope they continue to improve the product and fix bug along the way.

But after download the 5.1.2 version last night, I notice that the Intellij isn't as memory greedy than in the past. Maybe Intellij is on diet ... but then temptation can set in anytime, haha

0
Comment actions Permalink

... I'd much
prefer Idea give me the ability to set up profiles of
inspections I'm interested in but allow me turn off
ALL background processing (other than the normal
caching and source indexing it does). Then, WHEN I
CHOOSE, let me run a code inspection ...


Have you considered turning off code inspections in the editor and using the off-line code inspections ? I believe this is exactly what you describe here.

0
Comment actions Permalink

Also very easy is defining a couple of inspection profiles and switching editor highlighting using the "Quick Switch Scheme" functionality to switch between them when needed. For example define three profiles:
1. Empty, no inspections at all for full performance
2. Basic, a few of the most critical inspections
3. Full, all warnings you consider needed

Normally when programming use Basic, when editing a large file swith to Empty using Ctrl+Back Quote (Ctrl + `, View > Quick Switch Theme) and Switch Editor Highlighting and when full warnings are needed, e.g. when a piece of functionality is complete, switch to the Full profile.

Bas

0
Comment actions Permalink

Yes, but maybe you can help me out here. The only way I know how to do that is to turn off inspections, file by file, each time I edit the file. My project has over 500 files. And, at least as far as I can tell, once you close the file, you have to remember to turn off the inspections next time it's opened. This is exactly what I'm talking about - the profiles are there, the manual operation is there, but I can't find a way to turn OFF background inspecting globally. If I'm missing such a simple setting, I'd by extremely grateful if you could tell me where it is - I've posted this question before and never found an answser. If there is no way, then it seems to me the fix is relatively simple - just give me one additional option for the editor that says turn off all inspections globally - maybe even let me choose to leave syntax highlighting on but inspections off - ie. just like you can do with the little dude on the status bar at the bottom. But to make me do it manually for each file each time I edit seems like poor implementation, particularly when you've gone to the trouble to have the profiles and the manual execution. If it's there, or if it will be added, I would love to know that - seriously, the performance boost and responsiveness, for me anyway, would be enormously improved.
Thanks,
Scott

0
Comment actions Permalink

Create a new profile and uncheck all checkboxes of all inspection categories and use that profile.

Bas

0
Comment actions Permalink

OK, now maybe we're getting closer - thanks! I wasn't aware of ctrl+` - nor do I see it in the keymap. Now, maybe this is because I don't understand the difference between the default profile and editor highlight profile, but I don't seem to be able to set this at the project level. So, let's say I remove everything from one profile and have another with everything I want. When I use the quick switch capability, is that for the current file only? Can it be done globally or for an entire project? Is that setting saved? In other words, what I don't want is to have to go in and mess with some setting every single time I open a file - if I have to do that, then I'll just basically have to turn off all code inspections and do without the feature. If I can specify globally or at least for the project that one profile is to be used, then I can specify the other profile when I manually run inspections. If you can answer any of these questions, I'll be very grateful. I'll also look at snapping memory for issues I see. Right now, eg. I can load up a project, do a manual inspection, and I've grabbed a quarter gig of ram. Now, close project so there's nothing but the Idea frame and the memory isn't released, no matter how many times I hit the GC button.
Thanks for the info,
Scott

0
Comment actions Permalink

OK, now maybe we're getting closer - thanks! I
wasn't aware of ctrl+` - nor do I see it in the
keymap.


You can also find it in the "View" menu. All Actions > Main Menu > View > Quick Switch Scheme... in the keymap settings, if I recall correctly.

When I use the quick switch
capability, is that for the current file only?


The "Editor Highlight Profile" is the profile that is used for every file you open (in IDEA 5 at least, it's different in the 6.0 EAP).

Can it be done globally or for an entire project?


In IDEA 5 this is a global setting for all projects.

Is that setting saved?


Yes.

Bas

0
Comment actions Permalink

Year 2018. Memory leak still exists...

0
Comment actions Permalink

Year 2020. Memory leak still exists...

0
Comment actions Permalink

Hello,

Please report an issue on YouTrack (https://youtrack.jetbrains.com/issues/IDEA) attaching logs folder zipped ("Help | Show Log in...") and memory snapshot (https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems)

0
Comment actions Permalink

I created the issue report (https://youtrack.jetbrains.com/issue/IDEA-231347) with attaching logs folder and memory snapshots, but no results.

0
Comment actions Permalink

Igor,

Thanks! Issue is under investigation. Please keep following it for updates.

0

Please sign in to leave a comment.