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

问题描述

| 在运行IDEA几个小时后,我注意到导航器开始在编辑器中滞后。当我输入内容时,大约需要1-2秒才能解冻光标。当我打开新行时,它也会冻结一段时间(按Enter 5次会冻结IDEA 10秒钟左右,如果我每次都等到它解冻时),以及在类似情况下。感觉到当光标冻结时,它正在后台进行某种搜索(也许是索引搜索)。当前,jvm堆显示为674MB中的292MB。 这些问题可能与哪些有关,以及如何解决这些问题? [更新] 同时抛出“ 0”异常。
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
[更新二] 请注意,在Windows Task Manager中显示的内存使用量接近1GB(与建议的292MB不匹配)。 Intellij内置内存转储已产生500MB文件。 WTM显示Intellij中的内存也已减少到500MB(但仍然很慢)。     

解决方法

我曾经遇到过这类问题,它们似乎与源代码控制集成(特别是Perforce)有关。如果您使用源代码管理,请尝试将其禁用并查看会发生什么。