简体   繁体   English

编辑器滞后中的Intellij IDEA光标导航

[英]Intellij IDEA cursor navigation in editor lags

After running IDEA for a few hours I've noticed that navigation starts to lag in the Editor. 在运行IDEA几个小时后,我注意到导航器开始在编辑器中滞后。 When I type something in it takes about 1-2 seconds to unfreeze the cursor. 当我输入内容时,大约需要1-2秒才能解冻光标。 When I open a new line it also freezes for a while (pressing enter 5 times would freeze IDEA for around 10 seconds, if I wait every time until it unfreezes), as well as in similar situations. 当我打开新行时,它也会冻结一段时间(按Enter 5次会冻结IDEA大约10秒钟,如果我每次都等到它解冻时),以及类似情况。 It feels that it is doing some sort of search (maybe index search) in background when the cursor freezes. 感觉到当光标冻结时,它正在后台进行某种搜索(也许是索引搜索)。 Currently jvm heap shows at 292MB out of 674MB. 当前,jvm堆显示为674MB中的292MB。

What such problems can be related to and how to troubleshoot them? 这些问题可能与哪些有关,以及如何解决这些问题?

[UPDATE] [更新]

Also OutOfMemory exception is thrown. 此外,还会OutOfMemory异常。

at com.intellij.util.io.PersistentEnumerator.enumerateImpl(PersistentEnumerator.java:354)
at com.intellij.util.io.PersistentEnumerator.tryEnumerate(PersistentEnumerator.java:175)
at com.intellij.util.io.PersistentHashMap.get(PersistentHashMap.java:219)
at com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:78)
at com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:70)

Caused by: java.lang.RuntimeException: Mapping failed: C:\Users\...\Application Data\.IntelliJIdea90\system\index\idindex\IdIndex, position=0, length=10485760 

at com.intellij.util.io.ReadWriteMappedBufferWrapper.map(ReadWriteMappedBufferWrapper.java:51)
at com.intellij.util.io.MappedBufferWrapper.buf(MappedBufferWrapper.java:68)
at com.intellij.util.io.PagedFileStorage.getBuffer(PagedFileStorage.java:260)
at com.intellij.util.io.PagedFileStorage.get(PagedFileStorage.java:170)
at com.intellij.util.io.PagedFileStorage.getInt(PagedFileStorage.java:121)
at com.intellij.util.io.ResizeableMappedFile.getInt(ResizeableMappedFile.java:141)
at com.intellij.util.io.PersistentEnumerator.enumerateImpl(PersistentEnumerator.java:279)
... 39 more
Caused by: java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:748)
at com.intellij.util.io.ReadWriteMappedBufferWrapper.map(ReadWriteMappedBufferWrapper.java:48)
... 45 more
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:745)
... 46 more

[UPDATE II] [更新二]

Note that in Windows Task Manager memory usage is shown at nearly 1GB (which doesn't match suggested 292MB). 请注意,在Windows Task Manager中显示的内存使用量接近1GB(与建议的292MB不匹配)。 Intellij built-in memory dump has produced a 500MB file. Intellij内置内存转储已产生500MB文件。 WTM shown memory in Intellij has gone down to 500MB as well (but it is still slow). WTM显示Intellij中的内存也已减少到500MB(但仍然很慢)。

I used to have these types of problems and they seemed to be related to source control integration (Perforce in particular). 我曾经遇到过这类问题,它们似乎与源代码控制集成有关(尤其是Perforce)。 If you use source control, try to disable it and see what happens. 如果您使用源代码管理,请尝试将其禁用并查看会发生什么。

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

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