Vim在WIndows上占用了700MB内存,我如何调试它?

Vim在WIndows上占用了700MB内存,我如何调试它?,windows,vim,Windows,Vim,我在Windows server 2012上安装了Vim,当我从“开始”菜单启动它时,一切正常。但是,当我从命令行启动它时,它需要5秒钟,并使用700MB内存。即使它没有打开一个文件。有一些奇怪的事情正在发生,我想知道是否有任何方法来调试它/找出是什么导致了这一点?谢谢,埃里克 编辑: 下面是vim——startuptime输出文件(缩写)的结果: 以毫秒为单位的时间 时钟自源+源代码自源:源代码脚本 时钟已过:其他线路 000.000 000.000:--VIM启动--- 016.000 0

我在Windows server 2012上安装了Vim,当我从“开始”菜单启动它时,一切正常。但是,当我从命令行启动它时,它需要5秒钟,并使用700MB内存。即使它没有打开一个文件。有一些奇怪的事情正在发生,我想知道是否有任何方法来调试它/找出是什么导致了这一点?谢谢,埃里克

编辑:

下面是vim——startuptime输出文件(缩写)的结果:

以毫秒为单位的时间

时钟自源+源代码自源:源代码脚本

时钟已过:其他线路

000.000 000.000:--VIM启动---

016.000 016.000:解析参数

016.000.000:扩展参数

4794.000 4778.000:外壳初始化

4794.000 000.000:Termcap初始

4825.000.000:设置原始模式

8768.000 3943.000:启动期限上限

8768.000.000:清除屏幕


8783.000 000.000:---VIM已启动---

您可以使用Sysinternals的Process Explorer检查是否有任何流程正在启动子流程,或者环境变量是否存在任何差异

此外,Sysinternals的Procmon允许您检查任何应用程序使用的注册表项、文件等(通过
命令名
包括
vim
)进行筛选,但您可能只会在Process Explorer中发现差异

Sysinternals是一家为Windows创建了一些不错的应用程序的公司,微软在几年前买下了它。您可以在上访问他们的任何应用程序的最新版本:

它还提到了如何创建日志文件:

You can also use the -V command line argument to get more debug
information to analyze the problem: 

    $ vim -V2logfile

You can increase the value passed to the -V argument to get more debug
information. By also specifying a logfile name, this makes sure, the
debug messages don't appear on the screen and won't disturb you when
trying to reproduce the problem.

@ParamagneticCroissant,我还没有看到有人在Windows上使用Emacs。你能运行
vim--startuptime输出文件吗。这将为启动计时,并告诉您在何处需要很长时间。您的shell需要大约5秒的时间来初始化。(也只是在代码块中发布整个过程)shell init实际调用的是什么?我在一个定制的shell中运行,但是运行一个直接的cmd运行得很快。所以我尝试了vim-u NONE-u NONE-N-I NONE,它仍然使用至少700MB的内存。不知何故,我并不认为这是vim的一个bug,因为5天前这并没有发生,我并没有安装或升级vim。当运行vim-u NONE-u NONE-N-i NONE时,日志文件也是空白的,当正常运行时,日志文件是无趣的。另一个可能相关的点是起始目录,可以使用
:pwd
进行检查。
You can also use the -V command line argument to get more debug
information to analyze the problem: 

    $ vim -V2logfile

You can increase the value passed to the -V argument to get more debug
information. By also specifying a logfile name, this makes sure, the
debug messages don't appear on the screen and won't disturb you when
trying to reproduce the problem.