The IDE is really taking up too much memory
Answered
Can you optimize it as much as possible?
Just starting the editor takes up more than 3G of memory (IntelliJ IDEA 2021.1.1)
Original description:
idea占内存真的太多了,可以尽可能的优化下吗
仅仅启动编辑器就占超过3G内存(IntelliJ IDEA 2021.1.1)
Please sign in to leave a comment.
Hello Yin-junwu,
How big is your project? What type of files do you have in it?
Please attach the contents of your Help | About window.
Does it make a difference if you disable all non-bundled plugins and restart the IDE? Preferences | Plugins | ⚙️ | Disable all downloaded plugins
Memory usage depends mostly on the size of the projects. You may want to try increasing the heap size in Help | Change Memory Settings. If the heap size is too low, GC will run frequently using the CPU and slowing down the IDE.
你好,感谢你的热情解答。
但是很遗憾,按照你的方式操作完以后变化不大。
另外我项目不是很大,一般都是java的文件。
附上内存占用情况的截图,可以看到此时IDE已经占用了超过3G的内存。
我的IDE版本是IntelliJ IDEA 2021.1.1,是不是这个内存占用情况是正常的?
It is not unusual on Windows, the application is rather demanding in terms of memory. I am getting 2.2-2.5G right now with the latest version of IDEA and a very simple project.
However, the IDE itself can't consume more than the Xmx value (default is 2G) - once this limit is exceeded, an OutOfMemory error is thrown. Did you see any errors related to memory usage (OutOfMemory errors, prompts to increase the heap size)?
In my case, the IDE consumes well above the -Xmx limit. My limit is set to 2GB, but the actual RAM usage > 4GB. Can you explain it?
Sergey Zolotarev
Heap size never limits the total process memory, see https://stackoverflow.com/a/13489882/104891
IDE memory indicator shows how much memory is used out of all the memory allocated to the IDE process. On your screenshot, IDEA uses 792M out of 2048M that was allocated to the Java process to run the IDE.
The OS shows the memory which is currently allocated to the IDE as a program during its life time and it is not the same as the heap size of the JVM process. OS native memory usage may be lower than the max memory allocated to IDEA or a bit larger (as it also includes native Windows dll libraries that JVM memory does not), or even a lot more than the max allocated JVM heap as OS could use swapping.
You can limit -Xmx to 1GB to get less total memory usage if your system has less than 8GB of RAM and your projects are small.
See also http://karunsubramanian.com/uncategorized/why-is-there-a-discrepancy-between-windows-task-manager-memory-and-java-heap
I am running 2022.2 on an M1 mac with 32G of memory. I set max memory to 3G. I can see it is only using part of the in the lower right corner.
However in the task manager, it says that intellij is currently using 24G! When I first opened it, it only takes about 5G, but after a few days, it grows to 24G. How is that possible.
It puts memory pressure on the Mac even though I have 32G.
I also removed as many plugins as I could. Here are the ones that I currently use.
Hi Bbecker Probably, there is a leak in native memory (inside C/C++ code called by JNI). Does it make any difference if you change the
MALLOC_ARENA_MAX
environment variable value to 1? Don't hesitate to get in touch with JetBrains support at https://intellij-support.jetbrains.com/hc/en-us/requests/new and provide diagnostic data as per https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problemsWhy is lot consuming, can you explain why it is such consuming please ?
Ktari Anis Each case might be different. Please contact JetBrains support at https://intellij-support.jetbrains.com/hc/en-us/requests/new and provide diagnostic data as per https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems
It's not related to the project. I've opened the same project in Webstorm and VS Code.
VS Code consumes 4.4 times less memory.
Ben Beckers
In order to analyze your issue further, please submit a request to support here and provide the diagnostic data as explained in this article - in section 'Memory Leak or High Memory Consumption'.
Open one simple study project. MacBook pro m1
It's the same issue I'm facing when using both IDEA or pyCharm:
PhpStorm 2023.1.2
Simple project using up 4GB of my ram on MacOS, while xcode is only using 1GB - 1.5GB tops.
Already disabled most of the default unused plugins and bloatware that was enabled for god knows why
It is best to submit a support request here and provide the necessary diagnostic data (memory snapshot) as explained in this article (section 'Memory Leak or High Memory Consumption') and your IDE logs (Help > Collect Logs and Diagnostic Data).
نفس مشاكل الأخوة
Had same memory consuming problems after updating to 2023.1
Medium project took 3-4 GB and code analysis perform up to 40 seconds! I add a string of code and Idea "understands" it with big delay. Almost impossible to work. Sad story that previous version (I had 2022.1) was super fast on the same machine.
SOLUTION THAT WORKED FOR ME: use custom JDK runtime
Native JDK for 2023.1 is JBR 17, but I changed to OpenJDK 20 (latest) - now on the same project memory usage 800-1000 mb and instant reaction of IDE!
Hope it helps to someone suffering as me
I have the same problem Rider version 2023.1 is taking too much memory
Omar Coca
Please open a new issue here: https://youtrack.jetbrains.com/newIssue, and provide a memory snapshot along with your IDE logs (Help > Collect Logs and Diagnostic Data) for further analysis by the support team. Thank you.
i used to use webstorm.. and never had issues.. i mostly use node so webstorm covers it.. but i dabble in all kinds of different projects so i figured it would be better to use intellij and have been for a year or two.. but recently heard someone with the same experience say that because they use node they switched back to webstorm for most of the things they do.. and thats where i'm at now.. mono repos that are huge.. are fine in webstorm but in intellij they bring my mac book air with 16gb ram and a macbook pro also with with 16gb to its knees.. if i set the memory usage higher it will almost always consume the amount of memory i have it set to within a day or two.. basically my setting was 6gb in intellij.. and i just started back on webstorm.. and within a day it seems better even with the original 2gb setting..
Brianstoker
Thanks reporting this issue.
To analyze the root cause of IntelliJ high memory consumption issue - a memory snapshot and your IDE logs are needed.
To record a memory snapshot (during high consumption) please follow this article.
Since this thread is not suited for troubleshooting similar problems, it is best to open a new report on YouTrack bug tracker: https://youtrack.jetbrains.com/newIssue?project=IDEA and provide a memory snapshot along with your IDE logs (Help > Collect Logs and Diagnostic Data) for further analysis. Thanks!
My case is same story. IDE consumes 2-4 Gb of memory. Maximum heap size is set to 4096 MiB.
But as an experienced multiplatform developer I can say one thing, bros. It is consuming so much memory because it is written in Java.
Devs of JB prefer to go by the client-server way and the next platform will work remotely, potentially having server part outside of the client. But the most rational (of course not from point of view of business) solution would be to rewrite IDE completely in some native language like C++ or anything compilable directly into machine code (things like Java and dot NET are not applicable).
Then the IDE would be really lightweight in comparison.
What actually eats gigabytes of memory? It is Java Runtime (that such JRE). Being written in C++ it would take may be 300 Mb of mem even if we open large project.
IDE is cool, I use it on a daily basis. But that is the cost for the tools used to create it that all we should pay.
Ruslan ZH 's solution works for me! Head to https://www.jetbrains.com/help/webstorm/switching-boot-jdk.html, and select/use vanilla/nomod version.
I'm having the same issue.
2gb of memory is being used for a very simple spring boot application that is not even running.
I'm using a macbook pro m1 with 16gb ram if it makes any difference. Newly installed.
Under 3 plugins installed for intellij.
I'm having the same problem in Ubuntu with IntelliJ Ultimate No Plug Ins. I've opened two small projects (Node and React Native, not even my Java ones) and it's consuming more than 5GB of Ram. It's frustrating because sometimes I try to compile RN code and I ran out of memory, the PC freeze for seconds. I don't understand because my PC it's pretty decent (Ryzen 5700X, 16gb 3200mhz and RTX 3080).
But the funny part is that I don't get this when I use intelliJ on my Mac Mini 2018 Running Catalina, sometimes I open 4 IntelliJ windows and I don't have memory Hog.
Gabrielzardo Right click on the status bar and enable the Memory Indicator. How much memory does it show?
It taks 9G almost.
Any thoughts ?
Hi Tom Zhu
How big is your project? Roughly how many files are there in it?
Make sure you use the bundled JetBrains Runtime.
See if it helps to:
-Xmx
VM option value to 3-4GB: Help | Change Memory SettingsIf it doesn't, please collect additional data for analysis:
You can upload the files to https://uploads.jetbrains.com and provide the generated upload id here.
Tom Zhu It's likely you have this issue: https://youtrack.jetbrains.com/issue/JBR-3631/Intellij-high-memory-usage-on-apple-silicon-M1-7-8GB-of-RAM.