简体   繁体   English

IntelliJ IDEA 统计插件“内存不足”

[英]IntelliJ IDEA Statistic Plugin “Out of Memory”

I'm using the Statistic plugin for IntelliJ IDEA .我正在使用IntelliJ IDEAStatistic插件。 For one project of mine which has around 15.000 Java source code lines, Statistic gets stuck at 92% progress and then IntelliJ displays the following Out of Memory dialog:对于我的一个大约有 15.000 行 Java 源代码行的项目, Statistic卡在 92% 的进度上,然后IntelliJ显示以下Out of Memory对话框:

I tried increasing the memory but that causes IntelliJ to refuse starting up so I had to set the default 512MB again.我尝试增加内存,但这导致IntelliJ拒绝启动,所以我不得不再次设置默认的512MB

Why is this caused and how can it be fixed so I can calculate statistics about my project again?为什么会出现这种情况,如何修复它以便我可以再次计算有关我的项目的统计数据? Note that the error does not appear with "smaller" projects.请注意,“较小”的项目不会出现该错误。 In TaskManager , IntelliJ is at about 980MB of RAM usage but my machine has about 7GB RAM left in total.TaskManagerIntelliJRAM使用量约为980MB ,但我的机器总共剩余约7GB RAM

You can manually edit the idea.exe.vmoptions or idea64.exe.vmoptions file in your installation directory, and modify the following line to increase the max heap size used by IntelliJ:您可以手动编辑安装目录中的idea.exe.vmoptionsidea64.exe.vmoptions文件,并修改以下行以增加IntelliJ 使用的最大堆大小:

# Increase max heap size to 2GB.
-Xmx2g

TL, DR: Exclude large files in the Statistic plugin settings. TL、DR:统计插件设置中排除大文件。

The reason I had this problem was because of many multi-GB datafiles in the project directory.我遇到这个问题的原因是项目目录中有许多多 GB 的数据文件。 By excluding these large files, the problem was solved.通过排除这些大文件,问题就解决了。

In the settings of the Statistic plugin, you can exclude some file types and/or exclude certain (sub-) directories, to prevent the plugin from trying to read them.统计插件的设置中,您可以排除某些文件类型和/或排除某些(子)目录,以防止插件尝试读取它们。 If the files are not read, their content is not loaded into memory, preventing the Out of Memory error.如果未读取文件,则不会将其内容加载到内存中,从而防止出现 Out of Memory 错误。

The setting of the Statistic plugin are found in its tab (in the bottom left), just beneath the Refresh-button.统计插件的设置位于其选项卡(左下角)中,就在刷新按钮下方。 Alternatively, open them at Pycharm->Preferences->Tools->Statistic.或者,在 Pycharm->Preferences->Tools->Statistic 打开它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM